pub enum ForeignHandler {
Encode,
Decode,
Default,
HasShape,
Is,
Clone,
ToString,
Equals,
HashCode,
PartialCompare,
Compare,
}Expand description
One of the functions a foreign type declares.
Variants§
Encode
encode: the value as its wire form.
Decode
decode: the value from its wire form.
Default
default: a fresh value.
HasShape
hasShape: whether a raw value could be this type.
Is
is: whether a value is one of this type.
Clone
clone: a copy of the value.
ToString
toString: the value as Debug prints it.
Equals
equals: whether two values are equal.
HashCode
hashCode: the value’s hash.
PartialCompare
partialCompare: the order of two values, or null when they have none.
Compare
compare: the order of two values.
Implementations§
Source§impl ForeignHandler
impl ForeignHandler
Sourcepub fn export_name(self, type_name: &str) -> String
pub fn export_name(self, type_name: &str) -> String
The name the expanded config exports type_name’s handler under:
__foreign__ + the camel-cased type name + the handler, so
DateTime.DateTime’s encode is __foreign__dateTimeDateTimeEncode.
Trait Implementations§
Source§impl Clone for ForeignHandler
impl Clone for ForeignHandler
impl Copy for ForeignHandler
Source§impl Debug for ForeignHandler
impl Debug for ForeignHandler
Source§impl<'de> Deserialize<'de> for ForeignHandler
impl<'de> Deserialize<'de> for ForeignHandler
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
impl Eq for ForeignHandler
Source§impl Hash for ForeignHandler
impl Hash for ForeignHandler
Source§impl PartialEq for ForeignHandler
impl PartialEq for ForeignHandler
Source§impl Serialize for ForeignHandler
impl Serialize for ForeignHandler
impl StructuralPartialEq for ForeignHandler
Auto Trait Implementations§
impl Forget for ForeignHandler
impl Freeze for ForeignHandler
impl Move for ForeignHandler
impl RefUnwindSafe for ForeignHandler
impl Send for ForeignHandler
impl Sync for ForeignHandler
impl Unpin for ForeignHandler
impl UnsafeUnpin for ForeignHandler
impl UnwindSafe for ForeignHandler
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more