Struct serde_yml::libyml::error::Mark

source ·
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

source

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.

source

pub fn line(&self) -> u64

Retrieves the line number of the mark.

The line number indicates the line in the YAML input where the mark is located.

§Returns

Returns the line number of the mark as a u64.

source

pub fn column(&self) -> u64

Retrieves the column number of the mark.

The column number indicates the column within the line where the mark is located.

§Returns

Returns the column number of the mark as a u64.

Trait Implementations§

source§

impl Clone for Mark

source§

fn clone(&self) -> Mark

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Mark

source§

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

source§

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.

source§

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.