Created
July 18, 2023 22:48
-
-
Save TheDrawingCoder-Gamer/807ceb174267ce88c28599cf20610793 to your computer and use it in GitHub Desktop.
Sample of a struct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)] | |
#[serde(rename_all = "camelCase")] | |
pub struct Object<Kind> { | |
/// Identifies a resource attached or related to an object that potentially requires special | |
/// handling. | |
/// | |
/// The intent is to provide a model that is at least semantically similar to attachments in | |
/// email. | |
/// | |
/// - Range: Object | Link | |
/// - Functional: false | |
#[serde(skip_serializing_if = "Option::is_none")] | |
attachment: Option<OneOrMany<AnyBase>>, | |
/// Base fields and unparsed json ends up here | |
#[serde(flatten)] | |
inner: Base<Kind>, | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment