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