pub struct Variant {
name: MultiName,
rename_all_rules: RenameAllRules,
ser_bound: Option<Vec<WherePredicate>>,
de_bound: Option<Vec<WherePredicate>>,
skip_deserializing: bool,
skip_serializing: bool,
other: bool,
serialize_with: Option<ExprPath>,
deserialize_with: Option<ExprPath>,
borrow: Option<BorrowAttribute>,
untagged: bool,
}
Expand description
Represents variant attribute information
Fields§
§name: MultiName
§rename_all_rules: RenameAllRules
§ser_bound: Option<Vec<WherePredicate>>
§de_bound: Option<Vec<WherePredicate>>
§skip_deserializing: bool
§skip_serializing: bool
§other: bool
§serialize_with: Option<ExprPath>
§deserialize_with: Option<ExprPath>
§borrow: Option<BorrowAttribute>
§untagged: bool
Implementations§
source§impl Variant
impl Variant
pub fn from_ast(cx: &Ctxt, variant: &Variant) -> Self
pub fn name(&self) -> &MultiName
pub fn aliases(&self) -> &BTreeSet<Name>
pub fn rename_by_rules(&mut self, rules: RenameAllRules)
pub fn rename_all_rules(&self) -> RenameAllRules
pub fn ser_bound(&self) -> Option<&[WherePredicate]>
pub fn de_bound(&self) -> Option<&[WherePredicate]>
pub fn skip_deserializing(&self) -> bool
pub fn skip_serializing(&self) -> bool
pub fn other(&self) -> bool
pub fn serialize_with(&self) -> Option<&ExprPath>
pub fn deserialize_with(&self) -> Option<&ExprPath>
pub fn untagged(&self) -> bool
Auto Trait Implementations§
impl Freeze for Variant
impl RefUnwindSafe for Variant
impl !Send for Variant
impl !Sync for Variant
impl Unpin for Variant
impl UnwindSafe for Variant
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