Struct capnp::message::Reader

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

A container used to read a message.

Implementations§

source§

impl<S> Reader<S>
where S: ReaderSegments,

source

pub fn new(segments: S, options: ReaderOptions) -> Self

source

pub fn get_root<'a, T: FromPointerReader<'a>>(&'a self) -> Result<T>

Gets the root of the message, interpreting it as the given type.

source

pub fn into_segments(self) -> S

source

pub fn is_canonical(&self) -> Result<bool>

Checks whether the message is canonical.

source

pub fn canonicalize(&self) -> Result<Vec<Word>>

Gets the canonical form of this message. Works by copying the message twice. For a canonicalization method that only requires one copy, see message::Builder::set_root_canonical().

source

pub fn into_typed<T: Owned>(self) -> TypedReader<S, T>

Trait Implementations§

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.

Auto Trait Implementations§

§

impl<S> !Freeze for Reader<S>

§

impl<S> !RefUnwindSafe for Reader<S>

§

impl<S> Send for Reader<S>
where S: Send,

§

impl<S> !Sync for Reader<S>

§

impl<S> Unpin for Reader<S>
where S: Unpin,

§

impl<S> UnwindSafe for Reader<S>
where S: 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.