pub struct SnbtReader<'a> { /* private fields */ }
Implementations§
Source§impl<'a> SnbtReader<'a>
impl<'a> SnbtReader<'a>
pub fn new(input: &'a str) -> Self
Sourcepub fn parse_element(&mut self) -> Result<Value, SnbtError>
pub fn parse_element(&mut self) -> Result<Value, SnbtError>
Read the next element in the SNBT string.
SnbtErrorKind::TrailingData
cannot be returned because it is not
considered to be an error.
pub fn read(&mut self) -> Result<Value, SnbtError>
Sourcepub fn bytes_read(&self) -> usize
pub fn bytes_read(&self) -> usize
Get the number of bytes read. It’s useful when you want to read a SNBT string from an command argument since there may be trailing data.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SnbtReader<'a>
impl<'a> RefUnwindSafe for SnbtReader<'a>
impl<'a> Send for SnbtReader<'a>
impl<'a> Sync for SnbtReader<'a>
impl<'a> Unpin for SnbtReader<'a>
impl<'a> UnwindSafe for SnbtReader<'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