pub struct Reader<'a> { /* private fields */ }Expand description
Reads RFC 4251 data types from a byte slice, front to back.
Implementations§
Source§impl<'a> Reader<'a>
impl<'a> Reader<'a>
Sourcepub fn u8(&mut self) -> Result<u8, DecodeError>
pub fn u8(&mut self) -> Result<u8, DecodeError>
byte.
Sourcepub fn bool(&mut self) -> Result<bool, DecodeError>
pub fn bool(&mut self) -> Result<bool, DecodeError>
boolean: zero is false, any other value true (RFC 4251 §5).
Sourcepub fn u32(&mut self) -> Result<u32, DecodeError>
pub fn u32(&mut self) -> Result<u32, DecodeError>
uint32, big-endian.
Sourcepub fn string(&mut self) -> Result<&'a [u8], DecodeError>
pub fn string(&mut self) -> Result<&'a [u8], DecodeError>
string: a uint32 length and that many bytes.
Sourcepub fn utf8(&mut self) -> Result<&'a str, DecodeError>
pub fn utf8(&mut self) -> Result<&'a str, DecodeError>
A string that must be valid UTF-8.
Sourcepub fn name_list(&mut self) -> Result<Vec<String>, DecodeError>
pub fn name_list(&mut self) -> Result<Vec<String>, DecodeError>
name-list: a comma-separated string of names. The empty string is the empty list.
Sourcepub fn finish(&self) -> Result<(), DecodeError>
pub fn finish(&self) -> Result<(), DecodeError>
Succeeds only if every byte has been read.
Trait Implementations§
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> UnsafeUnpin for Reader<'a>
impl<'a> UnwindSafe for Reader<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more