Skip to main content

GffPathError

Enum GffPathError 

Source
pub enum GffPathError {
    EmptyPath,
    IndexAtRoot {
        path: String,
    },
    NoSuchField {
        at: String,
        label: String,
    },
    AmbiguousLabel {
        at: String,
        label: String,
        count: usize,
    },
    IndexOutOfRange {
        at: String,
        index: usize,
        len: usize,
    },
    NotAList {
        at: String,
        actual: &'static str,
    },
    NotAStruct {
        at: String,
        actual: &'static str,
    },
    TypeMismatch {
        at: String,
        existing: &'static str,
        replacement: &'static str,
    },
    AlreadyExists {
        at: String,
    },
    WrongSegmentKind {
        at: String,
        operation: &'static str,
        expected: &'static str,
    },
}
Expand description

A path that does not resolve, or an edit the tree will not take.

A Result rather than a hit-plus-diagnostics pair. A tier walk can half succeed, answering from a lower tier while a higher one was unreadable, and both halves matter. Addressing a path cannot: it arrives or it does not, for one reason.

Variants§

§

EmptyPath

A path with no segments names nothing to act on.

§

IndexAtRoot

A path started by indexing, with no list yet in hand.

Fields

§path: String

The path as supplied.

§

NoSuchField

The struct has no field under that label.

Fields

§at: String

Where the walk had reached.

§label: String

The label looked for.

§

AmbiguousLabel

The struct carries that label more than once.

Which copy the caller meant is not recoverable from the path, and the copies are not known to agree on anything but their value today.

Fields

§at: String

Where the walk had reached.

§label: String

The label looked for.

§count: usize

How many fields carry it.

§

IndexOutOfRange

The list is shorter than the index.

Fields

§at: String

Where the walk had reached.

§index: usize

The index asked for.

§len: usize

How many elements the list holds.

§

NotAList

A field was indexed and is not a list.

Fields

§at: String

Where the walk had reached.

§actual: &'static str

The type actually found.

§

NotAStruct

A field was descended into and is not a struct.

Fields

§at: String

Where the walk had reached.

§actual: &'static str

The type actually found.

§

TypeMismatch

The replacement is a different type from what the field holds.

The existing field’s type is the only oracle available here. The per-format schemas that could answer “what should this label be” live in rakata-generics, above this crate, and asking that question is validation, which belongs to lint.

Fields

§at: String

The field being replaced.

§existing: &'static str

The type currently stored.

§replacement: &'static str

The type offered.

§

AlreadyExists

insert was given a label the struct already carries.

Fields

§at: String

The field that is already present.

§

WrongSegmentKind

A field operation ended at a list index, or the reverse.

Fields

§at: String

The path as supplied.

§operation: &'static str

The operation that could not use it.

§expected: &'static str

The kind of last segment the operation needs.

Trait Implementations§

Source§

impl Clone for GffPathError

Source§

fn clone(&self) -> GffPathError

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for GffPathError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for GffPathError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for GffPathError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<GffPathError> for GffDocumentError

Source§

fn from(source: GffPathError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for GffPathError

Source§

fn eq(&self, other: &GffPathError) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for GffPathError

Source§

impl StructuralPartialEq for GffPathError

Auto Trait Implementations§

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
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§

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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.