pub struct CharOffsets { /* private fields */ }Expand description
Maps a yaml-rust2 char index to a byte offset in content, and a byte offset to the
end of its containing line.
yaml_rust2::scanner::Marker::index() increments once per char consumed by the
scanner (it is built over Parser::new_from_str’s str::chars() iterator) — despite
its own doc comment claiming “in bytes”, it is a character index, verified against
yaml-rust2 0.12’s Scanner::skip_non_blank/skip_blank (self.mark.index += 1 per
char, not per byte). For ASCII-only content the two coincide, but non-ASCII text
upstream of a value would silently desync every downstream byte-offset computation
without this table.
Implementations§
Source§impl CharOffsets
impl CharOffsets
Auto Trait Implementations§
impl Freeze for CharOffsets
impl RefUnwindSafe for CharOffsets
impl Send for CharOffsets
impl Sync for CharOffsets
impl Unpin for CharOffsets
impl UnsafeUnpin for CharOffsets
impl UnwindSafe for CharOffsets
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