pub struct ParsingContext {
pub state: ParserState,
pub version: ERNVersion,
pub current_path: Vec<String>,
pub current_depth: usize,
pub namespace_stack: Vec<HashMap<String, String>>,
pub text_buffer: String,
pub attributes: HashMap<String, String>,
}Expand description
Parsing context that tracks current state
Fields§
§state: ParserState§version: ERNVersion§current_path: Vec<String>§current_depth: usize§namespace_stack: Vec<HashMap<String, String>>§text_buffer: String§attributes: HashMap<String, String>Implementations§
Source§impl ParsingContext
impl ParsingContext
pub fn new(version: ERNVersion) -> Self
pub fn push_element(&mut self, name: &str)
pub fn pop_element(&mut self) -> Option<String>
pub fn current_element_path(&self) -> String
pub fn is_at_path(&self, path: &[&str]) -> bool
pub fn clear_text_buffer(&mut self)
pub fn add_text(&mut self, text: &str)
pub fn take_text(&mut self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParsingContext
impl RefUnwindSafe for ParsingContext
impl Send for ParsingContext
impl Sync for ParsingContext
impl Unpin for ParsingContext
impl UnwindSafe for ParsingContext
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