pub struct ScannerContext {
pub state: ScannerState,
pub flow_level: usize,
pub in_key: bool,
pub in_value: bool,
pub allow_simple_key: bool,
pub simple_keys: Vec<Option<Position>>,
}Expand description
Scanner context manager
Fields§
§state: ScannerStateCurrent scanner state
flow_level: usizeFlow level (0 = block context, >0 = flow context)
in_key: boolWhether we’re in a key position
in_value: boolWhether we’re in a value position
allow_simple_key: boolWhether simple keys are allowed
simple_keys: Vec<Option<Position>>Stack of simple key positions
Implementations§
Source§impl ScannerContext
impl ScannerContext
Sourcepub fn enter_flow(&mut self)
pub fn enter_flow(&mut self)
Enter flow context
Sourcepub fn save_simple_key(&mut self, position: Position)
pub fn save_simple_key(&mut self, position: Position)
Save a simple key position
Sourcepub fn clear_simple_key(&mut self)
pub fn clear_simple_key(&mut self)
Clear the current simple key
Sourcepub fn simple_key_allowed(&self) -> bool
pub fn simple_key_allowed(&self) -> bool
Check if a simple key is possible
Trait Implementations§
Source§impl Debug for ScannerContext
impl Debug for ScannerContext
Auto Trait Implementations§
impl Freeze for ScannerContext
impl RefUnwindSafe for ScannerContext
impl Send for ScannerContext
impl Sync for ScannerContext
impl Unpin for ScannerContext
impl UnwindSafe for ScannerContext
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