struct Parser<'a> {
input: &'a str,
cursor: usize,
recorded_error: Option<SnbtError>,
}Fields§
§input: &'a str§cursor: usize§recorded_error: Option<SnbtError>Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
const fn new(input: &'a str) -> Self
const fn can_read(&self) -> bool
const fn error(&self, kind: SnbtErrorKind) -> SnbtError
const fn error_at(cursor: usize, kind: SnbtErrorKind) -> SnbtError
fn record_error(&mut self, cursor: usize, kind: SnbtErrorKind)
fn resolve_error(&mut self, error: SnbtError) -> SnbtError
fn peek(&self) -> Option<char>
fn read(&mut self) -> Option<char>
fn skip_whitespace(&mut self)
fn consume_char(&mut self, expected: char) -> bool
fn consume_repeated_separator(&mut self, separator: char) -> bool
fn expect_char(&mut self, expected: char) -> Result<(), SnbtError>
fn parse_tag(&mut self) -> Result<NbtTag, SnbtError>
fn parse_compound(&mut self) -> Result<NbtCompound, SnbtError>
fn parse_map_key(&mut self) -> Result<String, SnbtError>
fn parse_list_or_array(&mut self) -> Result<NbtTag, SnbtError>
fn parse_typed_array( &mut self, array_type: TypedArrayKind, ) -> Result<NbtTag, SnbtError>
fn parse_integer_array( &mut self, default_kind: DefaultIntegerKind, allowed_kinds: &[IntegerKind], ) -> Result<Vec<i64>, SnbtError>
fn parse_unquoted_value(&mut self) -> Result<NbtTag, SnbtError>
fn parse_builtin(&mut self, name: &str) -> Result<NbtTag, SnbtError>
fn parse_builtin_arguments(&mut self) -> Result<Vec<NbtTag>, SnbtError>
fn parse_number( &mut self, default_kind: DefaultIntegerKind, allow_float: bool, ) -> Result<NbtTag, SnbtError>
fn parse_quoted_string(&mut self) -> Result<String, SnbtError>
fn parse_escape(&mut self) -> Result<char, SnbtError>
fn parse_code_point_escape( &mut self, digits: usize, digit_cursor: usize, ) -> Result<char, SnbtError>
fn parse_named_escape(&mut self) -> Result<char, SnbtError>
fn parse_unquoted_string(&mut self) -> Result<String, SnbtError>
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreWraps this value in an
Arc<SyncMutex<>>