pub struct Struct {
pub name: String,
pub serde_name: String,
pub description: String,
pub parameters: Vec<TypeParameter>,
pub fields: Fields,
pub transparent: bool,
pub codegen_config: LanguageSpecificTypeCodegenConfig,
}
Fields§
§name: String
Name of a struct, should be a valid Rust struct name identifier
serde_name: String
If a serialized name is not a valid Rust struct name identifier then this defines the name of a struct to be used in serialization
description: String
Markdown docs for the struct
parameters: Vec<TypeParameter>
Generic type parameters, if any
fields: Fields
§transparent: bool
If serde transparent attribute is set on a struct
codegen_config: LanguageSpecificTypeCodegenConfig
Implementations§
Source§impl Struct
impl Struct
pub fn new(name: impl Into<String>) -> Self
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of a struct, should be a valid Rust struct name identifier
Sourcepub fn serde_name(&self) -> &str
pub fn serde_name(&self) -> &str
Returns the name of a struct to be used in serialization
pub fn description(&self) -> &str
pub fn parameters(&self) -> Iter<'_, TypeParameter>
pub fn fields(&self) -> Iter<'_, Field>
pub fn transparent(&self) -> bool
Sourcepub fn is_alias(&self) -> bool
pub fn is_alias(&self) -> bool
Returns true if a struct has 1 field and it is either named “0” or is transparent in the serialized form
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Struct
impl<'de> Deserialize<'de> for Struct
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Instantiate for Struct
impl Instantiate for Struct
Source§fn instantiate(self, type_args: &[TypeReference]) -> Self
fn instantiate(self, type_args: &[TypeReference]) -> Self
Return a new non-generic Struct
with each type parameter substituted with a type
impl Eq for Struct
impl StructuralPartialEq for Struct
Auto Trait Implementations§
impl Freeze for Struct
impl RefUnwindSafe for Struct
impl Send for Struct
impl Sync for Struct
impl Unpin for Struct
impl UnwindSafe for Struct
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more