pub enum CustomField {
Type(String),
Delegate(String),
}Expand description
Customize encoding and decoding behaviour for a generated field
Variants§
Type(String)
Fully-qualified type name that replaces the generated type of the field.
This type must implement FieldEncode and FieldDecode.
Delegate(String)
Name of the other field that this field will delegate to.
The delegated field must have CustomField::Type configured. It will handle the decoding
and encoding of this field’s wire value.
Implementations§
Source§impl CustomField
impl CustomField
Sourcepub fn from_type(s: &str) -> Self
pub fn from_type(s: &str) -> Self
Constructs a CustomField::Type
Sourcepub fn from_delegate(s: &str) -> Self
pub fn from_delegate(s: &str) -> Self
Constructs a CustomField::Delegate
Trait Implementations§
Source§impl Clone for CustomField
impl Clone for CustomField
Source§fn clone(&self) -> CustomField
fn clone(&self) -> CustomField
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CustomField
impl Debug for CustomField
Source§impl<'de> Deserialize<'de> for CustomField
impl<'de> Deserialize<'de> for CustomField
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
Auto Trait Implementations§
impl Freeze for CustomField
impl RefUnwindSafe for CustomField
impl Send for CustomField
impl Sync for CustomField
impl Unpin for CustomField
impl UnwindSafe for CustomField
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