pub struct Container {Show 18 fields
name: MultiName,
transparent: bool,
deny_unknown_fields: bool,
default: Default,
rename_all_rules: RenameAllRules,
rename_all_fields_rules: RenameAllRules,
ser_bound: Option<Vec<WherePredicate>>,
de_bound: Option<Vec<WherePredicate>>,
tag: TagType,
type_from: Option<Type>,
type_try_from: Option<Type>,
type_into: Option<Type>,
remote: Option<Path>,
identifier: Identifier,
serde_path: Option<Path>,
is_packed: bool,
expecting: Option<String>,
non_exhaustive: bool,
}
Expand description
Represents struct or enum attribute information.
Fields§
§name: MultiName
§transparent: bool
§deny_unknown_fields: bool
§default: Default
§rename_all_rules: RenameAllRules
§rename_all_fields_rules: RenameAllRules
§ser_bound: Option<Vec<WherePredicate>>
§de_bound: Option<Vec<WherePredicate>>
§tag: TagType
§type_from: Option<Type>
§type_try_from: Option<Type>
§type_into: Option<Type>
§remote: Option<Path>
§identifier: Identifier
§serde_path: Option<Path>
§is_packed: bool
§expecting: Option<String>
Error message generated when type can’t be deserialized
non_exhaustive: bool
Implementations§
source§impl Container
impl Container
sourcepub fn from_ast(cx: &Ctxt, item: &DeriveInput) -> Self
pub fn from_ast(cx: &Ctxt, item: &DeriveInput) -> Self
Extract out the #[serde(...)]
attributes from an item.
pub fn name(&self) -> &MultiName
pub fn rename_all_rules(&self) -> RenameAllRules
pub fn rename_all_fields_rules(&self) -> RenameAllRules
pub fn transparent(&self) -> bool
pub fn deny_unknown_fields(&self) -> bool
pub fn default(&self) -> &Default
pub fn ser_bound(&self) -> Option<&[WherePredicate]>
pub fn de_bound(&self) -> Option<&[WherePredicate]>
pub fn tag(&self) -> &TagType
pub fn type_from(&self) -> Option<&Type>
pub fn type_try_from(&self) -> Option<&Type>
pub fn type_into(&self) -> Option<&Type>
pub fn remote(&self) -> Option<&Path>
pub fn is_packed(&self) -> bool
pub fn identifier(&self) -> Identifier
pub fn custom_serde_path(&self) -> Option<&Path>
pub fn serde_path(&self) -> Cow<'_, Path>
sourcepub fn expecting(&self) -> Option<&str>
pub fn expecting(&self) -> Option<&str>
Error message generated when type can’t be deserialized.
If None
, default message will be used
pub fn non_exhaustive(&self) -> bool
Auto Trait Implementations§
impl Freeze for Container
impl RefUnwindSafe for Container
impl !Send for Container
impl !Sync for Container
impl Unpin for Container
impl UnwindSafe for Container
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