Skip to main content

Ty

Enum Ty 

Source
pub enum Ty<L: LinkingScheme> {
Show 15 variants Enum(Enum<L>), Struct(Struct<L>), Tuple(Tuple<L>), Option { value: L::TypeLink, }, Integer(IntegerType, IntegerDisplay), ByteArray { len: usize, display: ByteDisplay, }, Float32, Float64, String, Boolean, Skip { len: usize, }, ByteVec { display: ByteDisplay, }, Array { len: usize, value: L::TypeLink, }, Vec { value: L::TypeLink, }, Map { key: L::TypeLink, value: L::TypeLink, },
}

Variants§

§

Enum(Enum<L>)

§

Struct(Struct<L>)

§

Tuple(Tuple<L>)

§

Option

Fields

§value: L::TypeLink
§

Integer(IntegerType, IntegerDisplay)

§

ByteArray

Fields

§len: usize
§display: ByteDisplay
§

Float32

§

Float64

§

String

§

Boolean

§

Skip

Fields

§len: usize
§

ByteVec

Fields

§display: ByteDisplay
§

Array

Fields

§len: usize
§value: L::TypeLink
§

Vec

Fields

§value: L::TypeLink
§

Map

Fields

§key: L::TypeLink
§value: L::TypeLink

Implementations§

Source§

impl<L: LinkingScheme> Ty<L>

Source

pub fn visit<V: TypeVisitor<L, M>, M>( &self, schema: &impl TypeResolver<LinkingScheme = L, Metadata = M>, visitor: &mut V, arg: V::Arg, ) -> V::ReturnType

Source§

impl<L: LinkingScheme> Ty<L>

Source

pub fn is_skip(&self) -> bool

Returns true if the type is a skip type

Source§

impl Ty<IndexLinking>

Source

pub fn fill_next_placholder(&mut self, child: Link)

Fills the next available placeholder in the type with the given link, panicking if no placeholder is available.

Source§

impl<L: LinkingScheme> Ty<L>

Source

pub fn is_primitive(&self) -> bool

Source

pub fn parent_byte_references(&self) -> Vec<(usize, usize)>

Trait Implementations§

Source§

impl<L> BorshDeserialize for Ty<L>

Source§

fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>

Source§

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.
Source§

fn try_from_slice(v: &[u8]) -> Result<Self, Error>

Deserialize this instance from a slice of bytes.
Source§

fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>
where R: Read,

Source§

impl<L> BorshSerialize for Ty<L>

Source§

fn serialize<__W: Write>(&self, writer: &mut __W) -> Result<(), Error>

Source§

impl<L: Clone + LinkingScheme> Clone for Ty<L>
where L::TypeLink: Clone,

Source§

fn clone(&self) -> Ty<L>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<L: Debug + LinkingScheme> Debug for Ty<L>
where L::TypeLink: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<L> EnumExt for Ty<L>

Source§

fn deserialize_variant<__R: Read>( reader: &mut __R, variant_tag: u8, ) -> Result<Self, Error>

Deserialises given variant of an enum from the reader. Read more
Source§

impl<L: LinkingScheme> From<Container<L>> for Ty<L>

Source§

fn from(value: Container<L>) -> Self

Converts to this type from the input type.
Source§

impl<L: LinkingScheme> From<Primitive> for Ty<L>

Source§

fn from(val: Primitive) -> Self

Converts to this type from the input type.
Source§

impl<L: PartialEq + LinkingScheme> PartialEq for Ty<L>
where L::TypeLink: PartialEq,

Source§

fn eq(&self, other: &Ty<L>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<L: LinkingScheme> TryFrom<Ty<L>> for Container<L>

Source§

type Error = ErrNotAContainer

The type returned in the event of a conversion error.
Source§

fn try_from(value: Ty<L>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<L: LinkingScheme> TryFrom<Ty<L>> for Primitive

Source§

type Error = ErrNotAPrimitive

The type returned in the event of a conversion error.
Source§

fn try_from(value: Ty<L>) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<L: Eq + LinkingScheme> Eq for Ty<L>
where L::TypeLink: Eq,

Source§

impl<L: LinkingScheme> StructuralPartialEq for Ty<L>

Auto Trait Implementations§

§

impl<L> Freeze for Ty<L>
where <L as LinkingScheme>::TypeLink: Freeze,

§

impl<L> RefUnwindSafe for Ty<L>

§

impl<L> Send for Ty<L>
where <L as LinkingScheme>::TypeLink: Send,

§

impl<L> Sync for Ty<L>
where <L as LinkingScheme>::TypeLink: Sync,

§

impl<L> Unpin for Ty<L>
where <L as LinkingScheme>::TypeLink: Unpin,

§

impl<L> UnsafeUnpin for Ty<L>

§

impl<L> UnwindSafe for Ty<L>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.