pub struct Position {
pub line: usize,
pub column: usize,
pub index: usize,
}Expand description
Represents a position in the YAML input stream
Fields§
§line: usizeLine number (1-based)
column: usizeColumn number (1-based)
index: usizeByte index in the input (0-based)
Implementations§
Source§impl Position
impl Position
Sourcepub const fn at(line: usize, column: usize, index: usize) -> Self
pub const fn at(line: usize, column: usize, index: usize) -> Self
Create a position with specific values
Sourcepub fn advance_str(self, s: &str) -> Self
pub fn advance_str(self, s: &str) -> Self
Advance position by a string
Sourcepub const fn advance_by(self, count: usize, is_newline: bool) -> Self
pub const fn advance_by(self, count: usize, is_newline: bool) -> Self
Advance position by multiple characters
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Position
impl<'de> Deserialize<'de> for Position
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Position
impl Ord for Position
Source§impl PartialOrd for Position
impl PartialOrd for Position
impl Copy for Position
impl Eq for Position
impl StructuralPartialEq for Position
Auto Trait Implementations§
impl Freeze for Position
impl RefUnwindSafe for Position
impl Send for Position
impl Sync for Position
impl Unpin for Position
impl UnwindSafe for Position
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.