pub struct AsWrap<T, As: ?Sized> { /* private fields */ }Expand description
An adaptor to convert from BorshSerializeAs and BorshDeserializeAs
to the corresponding [borsh] traits.
Implementations§
Trait Implementations§
Source§impl<T, As> BorshDeserialize for AsWrap<T, As>where
As: BorshDeserializeAs<T> + ?Sized,
impl<T, As> BorshDeserialize for AsWrap<T, As>where
As: BorshDeserializeAs<T> + ?Sized,
fn deserialize_reader<R: Read>(reader: &mut R) -> Result<Self>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl<T, As> BorshSchema for AsWrap<T, As>where
T: BorshSchema,
As: ?Sized,
impl<T, As> BorshSchema for AsWrap<T, As>where
T: BorshSchema,
As: ?Sized,
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
Source§impl<T, As> BorshSerialize for AsWrap<T, As>where
As: BorshSerializeAs<T> + ?Sized,
impl<T, As> BorshSerialize for AsWrap<T, As>where
As: BorshSerializeAs<T> + ?Sized,
Source§impl<T: Ord, As: Ord + ?Sized> Ord for AsWrap<T, As>
impl<T: Ord, As: Ord + ?Sized> Ord for AsWrap<T, As>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: PartialEq, As: PartialEq + ?Sized> PartialEq for AsWrap<T, As>
impl<T: PartialEq, As: PartialEq + ?Sized> PartialEq for AsWrap<T, As>
Source§impl<T: PartialOrd, As: PartialOrd + ?Sized> PartialOrd for AsWrap<T, As>
impl<T: PartialOrd, As: PartialOrd + ?Sized> PartialOrd for AsWrap<T, As>
impl<T: Copy, As: Copy + ?Sized> Copy for AsWrap<T, As>
impl<T: Eq, As: Eq + ?Sized> Eq for AsWrap<T, As>
impl<T, As: ?Sized> StructuralPartialEq for AsWrap<T, As>
Auto Trait Implementations§
impl<T, As> Freeze for AsWrap<T, As>
impl<T, As> RefUnwindSafe for AsWrap<T, As>
impl<T, As> Send for AsWrap<T, As>
impl<T, As> Sync for AsWrap<T, As>
impl<T, As> Unpin for AsWrap<T, As>
impl<T, As> UnsafeUnpin for AsWrap<T, As>where
T: UnsafeUnpin,
As: ?Sized,
impl<T, As> UnwindSafe for AsWrap<T, As>
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