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
)