Struct capnp::message::TypedReader

source ·
pub struct TypedReader<S, T>
where S: ReaderSegments, T: Owned,
{ /* private fields */ }
Expand description

A message reader whose value is known to be of type T. Please see module documentation for more info about reader type specialization.

Implementations§

source§

impl<S, T> TypedReader<S, T>
where S: ReaderSegments, T: Owned,

source

pub fn new(message: Reader<S>) -> Self

source

pub fn get(&self) -> Result<T::Reader<'_>>

source

pub fn into_inner(self) -> Reader<S>

Trait Implementations§

source§

impl<A, T> From<Builder<A>> for TypedReader<Builder<A>, T>
where A: Allocator, T: Owned,

source§

fn from(message: Builder<A>) -> Self

Converts to this type from the input type.
source§

impl<S, T> From<Reader<S>> for TypedReader<S, T>
where S: ReaderSegments, T: Owned,

source§

fn from(message: Reader<S>) -> Self

Converts to this type from the input type.
source§

impl<A, T> From<TypedBuilder<T, A>> for TypedReader<Builder<A>, T>
where A: Allocator, T: Owned,

source§

fn from(builder: TypedBuilder<T, A>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<S, T> !Freeze for TypedReader<S, T>

§

impl<S, T> !RefUnwindSafe for TypedReader<S, T>

§

impl<S, T> Send for TypedReader<S, T>
where S: Send, T: Send,

§

impl<S, T> !Sync for TypedReader<S, T>

§

impl<S, T> Unpin for TypedReader<S, T>
where S: Unpin, T: Unpin,

§

impl<S, T> UnwindSafe for TypedReader<S, T>
where S: UnwindSafe, 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<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, U> TryFrom<U> for T
where U: Into<T>,

§

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

§

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.