Skip to main content

Elem

Struct Elem 

Source
pub struct Elem<T>(/* private fields */);
๐Ÿ‘ŽDeprecated since 0.2.0: Elem is no longer needed for container usage. Use T directly instead.
Expand description

Indicates that the type is an element of a sequence, composable with containers.

Prefer Pod for types representable as raw bytes.

Trait Implementationsยง

Sourceยง

impl<'de, T> SchemaRead<'de> for Elem<T>
where T: SchemaRead<'de>,

Sourceยง

const TYPE_META: TypeMeta = T::TYPE_META

Sourceยง

type Dst = <T as SchemaRead<'de>>::Dst

Sourceยง

fn read( reader: &mut impl Reader<'de>, dst: &mut MaybeUninit<Self::Dst>, ) -> ReadResult<()>

Read into dst from reader. Read more
Sourceยง

fn get(reader: &mut impl Reader<'de>) -> ReadResult<Self::Dst>

Read Self::Dst from reader into a new Self::Dst.
Sourceยง

impl<T> SchemaWrite for Elem<T>
where T: SchemaWrite,

Sourceยง

const TYPE_META: TypeMeta = T::TYPE_META

Sourceยง

type Src = <T as SchemaWrite>::Src

Sourceยง

fn size_of(src: &Self::Src) -> WriteResult<usize>

Get the serialized size of Self::Src.
Sourceยง

fn write(writer: &mut impl Writer, src: &Self::Src) -> WriteResult<()>

Write Self::Src to writer.

Auto Trait Implementationsยง

ยง

impl<T> Freeze for Elem<T>

ยง

impl<T> RefUnwindSafe for Elem<T>
where T: RefUnwindSafe,

ยง

impl<T> Send for Elem<T>
where T: Send,

ยง

impl<T> Sync for Elem<T>
where T: Sync,

ยง

impl<T> Unpin for Elem<T>
where T: Unpin,

ยง

impl<T> UnsafeUnpin for Elem<T>

ยง

impl<T> UnwindSafe for Elem<T>
where T: UnwindSafe,

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<'de, T> Deserialize<'de> for T
where T: SchemaRead<'de>,

Sourceยง

fn deserialize(src: &'de [u8]) -> ReadResult<Self::Dst>

Deserialize bytes into a new Self::Dst.
Sourceยง

fn deserialize_into( src: &'de [u8], dst: &mut MaybeUninit<Self::Dst>, ) -> ReadResult<()>

Deserialize bytes into target.
Sourceยง

impl<T> DeserializeOwned for T
where T: SchemaReadOwned,

Sourceยง

fn deserialize_from<'de>( src: &mut impl Reader<'de>, ) -> ReadResult<<Self as SchemaRead<'de>>::Dst>

Deserialize from the given Reader into a new Self::Dst.
Sourceยง

fn deserialize_from_into<'de>( src: &mut impl Reader<'de>, dst: &mut MaybeUninit<<Self as SchemaRead<'de>>::Dst>, ) -> ReadResult<()>

Deserialize from the given Reader into dst.
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> Serialize for T
where T: SchemaWrite + ?Sized,

Sourceยง

fn serialize(src: &Self::Src) -> WriteResult<Vec<u8>>

Available on crate feature alloc only.
Serialize a serializable type into a Vec of bytes.
Sourceยง

fn serialize_into(dst: &mut impl Writer, src: &Self::Src) -> WriteResult<()>

Serialize a serializable type into the given byte buffer.
Sourceยง

fn serialized_size(src: &Self::Src) -> WriteResult<u64>

Get the size in bytes of the type when serialized.
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.
Sourceยง

impl<T> SchemaReadOwned for T
where T: for<'de> SchemaRead<'de>,