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,
impl<S> Reader<S>where
S: ReaderSegments,
pub fn new(segments: S, options: ReaderOptions) -> Self
sourcepub fn get_root<'a, T: FromPointerReader<'a>>(&'a self) -> Result<T>
pub fn get_root<'a, T: FromPointerReader<'a>>(&'a self) -> Result<T>
Gets the root of the message, interpreting it as the given type.
pub fn into_segments(self) -> S
sourcepub fn is_canonical(&self) -> Result<bool>
pub fn is_canonical(&self) -> Result<bool>
Checks whether the message is canonical.
sourcepub fn canonicalize(&self) -> Result<Vec<Word>>
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()
.
pub fn into_typed<T: for<'a> Owned<'a>>(self) -> TypedReader<S, T>
Trait Implementations§
source§impl<S, T> From<Reader<S>> for TypedReader<S, T>where
S: ReaderSegments,
T: for<'a> Owned<'a>,
impl<S, T> From<Reader<S>> for TypedReader<S, T>where
S: ReaderSegments,
T: for<'a> Owned<'a>,
source§fn from(message: Reader<S>) -> TypedReader<S, T>
fn from(message: Reader<S>) -> TypedReader<S, T>
Converts to this type from the input type.