Enum Reader

Source
pub enum Reader<'a> {
Show 19 variants Void, Bool(bool), Int8(i8), Int16(i16), Int32(i32), Int64(i64), UInt8(u8), UInt16(u16), UInt32(u32), UInt64(u64), Float32(f32), Float64(f64), Enum(Enum), Text(Reader<'a>), Data(Reader<'a>), Struct(Reader<'a>), List(Reader<'a>), AnyPointer(Reader<'a>), Capability(Capability),
}
Expand description

A dynamically-typed read-only value.

Variants§

§

Void

§

Bool(bool)

§

Int8(i8)

§

Int16(i16)

§

Int32(i32)

§

Int64(i64)

§

UInt8(u8)

§

UInt16(u16)

§

UInt32(u32)

§

UInt64(u64)

§

Float32(f32)

§

Float64(f64)

§

Enum(Enum)

§

Text(Reader<'a>)

§

Data(Reader<'a>)

§

Struct(Reader<'a>)

§

List(Reader<'a>)

§

AnyPointer(Reader<'a>)

§

Capability(Capability)

Implementations§

Source§

impl<'a> Reader<'a>

Source

pub fn new(value: Reader<'a>, ty: Type) -> Result<Self>

Source

pub fn downcast<T: DowncastReader<'a>>(self) -> T

Downcasts the Reader into a more specific type. Panics if the expected type does not match the value.

Source

pub fn downcast_struct<T: OwnedStruct>(self) -> T::Reader<'a>

Downcasts the Reader into a specific struct type. Panics if the expected type does not match the value.

Design note: instead of this method, it would be better to add a blanket impl of the DowncastBuilder trait that covered every struct type. Unfortunately, the current way the Introspect and OwnedStruct traits are set up does not seem to allow this.

Trait Implementations§

Source§

impl<'a> Clone for Reader<'a>

Source§

fn clone(&self) -> Reader<'a>

Returns a copy 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 Debug for Reader<'_>

Source§

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

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

impl<'a> From<&'a [u8]> for Reader<'a>

Source§

fn from(d: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for Reader<'a>

Source§

fn from(t: &'a str) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<()> for Reader<'a>

Source§

fn from((): ()) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Capability> for Reader<'a>

Source§

fn from(c: Capability) -> Reader<'a>

Converts to this type from the input type.
Source§

impl From<ElementSize> for Reader<'_>

Source§

fn from(e: ElementSize) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Enum> for Reader<'a>

Source§

fn from(e: Enum) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(a: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(t: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(t: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(x: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(x: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(t: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(t: Reader<'a>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a> From<Reader<'a>> for Reader<'a>

Source§

fn from(reader: Reader<'a>) -> Self

Converts to this type from the input type.
Source§

impl<'a, T: FromClientHook> From<Reader<'a, T>> for Reader<'a>

Source§

fn from(t: Reader<'a, T>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a, T: TryFrom<u16, Error = NotInSchema> + Introspect> From<Reader<'a, T>> for Reader<'a>

Source§

fn from(t: Reader<'a, T>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a, T: Owned> From<Reader<'a, T>> for Reader<'a>

Source§

fn from(t: Reader<'a, T>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a, T: PrimitiveElement + Introspect> From<Reader<'a, T>> for Reader<'a>

Source§

fn from(t: Reader<'a, T>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a, T: OwnedStruct> From<Reader<'a, T>> for Reader<'a>

Source§

fn from(t: Reader<'a, T>) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<bool> for Reader<'a>

Source§

fn from(x: bool) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<f32> for Reader<'a>

Source§

fn from(x: f32) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<f64> for Reader<'a>

Source§

fn from(x: f64) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<i16> for Reader<'a>

Source§

fn from(x: i16) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<i32> for Reader<'a>

Source§

fn from(x: i32) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<i64> for Reader<'a>

Source§

fn from(x: i64) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<i8> for Reader<'a>

Source§

fn from(x: i8) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<u16> for Reader<'a>

Source§

fn from(x: u16) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<u32> for Reader<'a>

Source§

fn from(x: u32) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<u64> for Reader<'a>

Source§

fn from(x: u64) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> From<u8> for Reader<'a>

Source§

fn from(x: u8) -> Reader<'a>

Converts to this type from the input type.
Source§

impl<'a> Copy for Reader<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Reader<'a>

§

impl<'a> !RefUnwindSafe for Reader<'a>

§

impl<'a> !Send for Reader<'a>

§

impl<'a> !Sync for Reader<'a>

§

impl<'a> Unpin for Reader<'a>

§

impl<'a> !UnwindSafe for Reader<'a>

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