pub enum FieldError {
NoStaticFields,
NoSuchStaticField,
IndexOutOfBounds,
NotAStruct,
}
Expand description
Errors encountered when calling field_by_index
or field_by_name
Variants§
NoStaticFields
field_by_index
was called on a dynamic collection, that has no
static fields. a map doesn’t have a “first field”, it can only
associate by keys.
NoSuchStaticField
field_by_name
was called on a struct, and there is no static field
with the given key.
IndexOutOfBounds
field_by_index
was called on a fixed-size collection (like a tuple,
a struct, or a fixed-size array) and the index was out of bounds.
NotAStruct
field_by_index
or field_by_name
was called on a non-struct type.
Trait Implementations§
Source§impl Clone for FieldError
impl Clone for FieldError
Source§fn clone(&self) -> FieldError
fn clone(&self) -> FieldError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for FieldError
impl Debug for FieldError
Source§impl Display for FieldError
impl Display for FieldError
Source§impl Error for FieldError
impl Error for FieldError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl PartialEq for FieldError
impl PartialEq for FieldError
impl Copy for FieldError
impl Eq for FieldError
impl StructuralPartialEq for FieldError
Auto Trait Implementations§
impl Freeze for FieldError
impl RefUnwindSafe for FieldError
impl Send for FieldError
impl Sync for FieldError
impl Unpin for FieldError
impl UnwindSafe for FieldError
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