pub struct Mark {
pub sys: YamlMarkT,
}
Expand description
Represents a mark in a YAML document. A mark indicates a specific position or location within the document.
Fields§
§sys: YamlMarkT
The underlying system representation of the mark.
This field is marked as pub(super)
, which means it is accessible within the current module
and its parent module, but not from outside the crate.
Implementations§
Source§impl Mark
impl Mark
Sourcepub fn index(&self) -> u64
pub fn index(&self) -> u64
Retrieves the index of the mark.
The index represents the position of the mark within the YAML input.
§Returns
Returns the index of the mark as a u64
.
Trait Implementations§
Source§impl Debug for Mark
impl Debug for Mark
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats the mark for debugging purposes.
The mark is formatted as a debug struct with either the line and column numbers or the index, depending on their values.
§Arguments
formatter
- The formatter to write the debug output to.
§Returns
Returns Ok(())
if the formatting was successful, or an error otherwise.
Source§impl Display for Mark
impl Display for Mark
Source§fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
fn fmt(&self, formatter: &mut Formatter<'_>) -> Result
Formats the mark for display purposes.
If the line and column numbers are non-zero, the mark is formatted as “line X column Y”. Otherwise, the mark is formatted as “position Z”, where Z is the index.
§Arguments
formatter
- The formatter to write the display output to.
§Returns
Returns Ok(())
if the formatting was successful, or an error otherwise.
impl Copy for Mark
Auto Trait Implementations§
impl Freeze for Mark
impl RefUnwindSafe for Mark
impl Send for Mark
impl Sync for Mark
impl Unpin for Mark
impl UnwindSafe for Mark
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)