pub struct Field {Show 13 fields
name: MultiName,
skip_serializing: bool,
skip_deserializing: bool,
skip_serializing_if: Option<ExprPath>,
default: Default,
serialize_with: Option<ExprPath>,
deserialize_with: Option<ExprPath>,
ser_bound: Option<Vec<WherePredicate>>,
de_bound: Option<Vec<WherePredicate>>,
borrowed_lifetimes: BTreeSet<Lifetime>,
getter: Option<ExprPath>,
flatten: bool,
transparent: bool,
}
Expand description
Represents field attribute information
Fields§
§name: MultiName
§skip_serializing: bool
§skip_deserializing: bool
§skip_serializing_if: Option<ExprPath>
§default: Default
§serialize_with: Option<ExprPath>
§deserialize_with: Option<ExprPath>
§ser_bound: Option<Vec<WherePredicate>>
§de_bound: Option<Vec<WherePredicate>>
§borrowed_lifetimes: BTreeSet<Lifetime>
§getter: Option<ExprPath>
§flatten: bool
§transparent: bool
Implementations§
source§impl Field
impl Field
sourcepub fn from_ast(
cx: &Ctxt,
index: usize,
field: &Field,
attrs: Option<&Variant>,
container_default: &Default,
) -> Self
pub fn from_ast( cx: &Ctxt, index: usize, field: &Field, attrs: Option<&Variant>, container_default: &Default, ) -> Self
Extract out the #[serde(...)]
attributes from a struct field.
pub fn name(&self) -> &MultiName
pub fn aliases(&self) -> &BTreeSet<Name>
pub fn rename_by_rules(&mut self, rules: RenameAllRules)
pub fn skip_serializing(&self) -> bool
pub fn skip_deserializing(&self) -> bool
pub fn skip_serializing_if(&self) -> Option<&ExprPath>
pub fn default(&self) -> &Default
pub fn serialize_with(&self) -> Option<&ExprPath>
pub fn deserialize_with(&self) -> Option<&ExprPath>
pub fn ser_bound(&self) -> Option<&[WherePredicate]>
pub fn de_bound(&self) -> Option<&[WherePredicate]>
pub fn borrowed_lifetimes(&self) -> &BTreeSet<Lifetime>
pub fn getter(&self) -> Option<&ExprPath>
pub fn flatten(&self) -> bool
pub fn transparent(&self) -> bool
pub fn mark_transparent(&mut self)
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl !Send for Field
impl !Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
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