VisitError

Enum VisitError 

Source
pub enum VisitError {
Show 17 variants Io(Error), UnknownFieldType(u8), FieldDoesNotExist(String), FieldAlreadyExists(String), RegionAlreadyExists(String), InvalidCurrentNode, FieldTypeDoesNotMatch, RegionDoesNotExist(String), NoActiveNode, NotSupportedFormat, InvalidName, TypeMismatch, RefCellAlreadyMutableBorrowed, User(String), UnexpectedRcNullIndex, PoisonedMutex, FileLoadError(FileLoadError),
}
Expand description

Errors that may occur while reading or writing Visitor.

Variants§

§

Io(Error)

An std::io::Error occured while reading or writing a file with Visitor data.

§

UnknownFieldType(u8)

When a field is encoded as bytes, the field data is prefixed by an identifying byte to allow the bytes to be decoded. This error happens when an identifying byte is expected during decoding, but an unknown value is found in that byte.

§

FieldDoesNotExist(String)

Attempting to visit a field on a read-mode Visitor when no field in the visitor data has the given name.

§

FieldAlreadyExists(String)

Attempting to visit a field on a write-mode Visitor when a field already has the given name.

§

RegionAlreadyExists(String)

Attempting to enter a region on a write-mode Visitor when a region already has the given name.

§

InvalidCurrentNode

§

FieldTypeDoesNotMatch

Attempting to visit a field using a read-mode Visitor when when that field was originally written using a value of a different type.

§

RegionDoesNotExist(String)

Attempting to enter a region on a read-mode Visitor when no region in the visitor’s data has the given name.

§

NoActiveNode

The Visitor tried to leave is current node, but somehow it had no current node. This should never happen.

§

NotSupportedFormat

The Visitor::MAGIC bytes were missing from the beginning of encoded Visitor data.

§

InvalidName

Some sequence of bytes was not in UTF8 format.

§

TypeMismatch

Visitor data can be self-referential, such as when the data contains multiple Rc references to a single shared value. This causes the visitor to store the data once and then later references to the same value point back to its first occurrence. This error occurs if one of these references points to a value of the wrong type.

§

RefCellAlreadyMutableBorrowed

Attempting to visit a mutably borrowed RefCell.

§

User(String)

A plain-text error message that could indicate almost anything.

§

UnexpectedRcNullIndex

Rc and Arc values store an “Id” value in the Visitor data which is based in their internal pointer. This error indicates that while reading this data, one of those Id values was discovered by be 0.

§

PoisonedMutex

A poison error occurred while trying to visit a mutex.

§

FileLoadError(FileLoadError)

A FileLoadError was encountered while trying to decode Visitor data from a file.

Trait Implementations§

Source§

impl Debug for VisitError

Source§

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

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

impl Display for VisitError

Source§

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

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

impl Error for VisitError

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<Error> for VisitError

Source§

fn from(io_err: Error) -> Self

Converts to this type from the input type.
Source§

impl From<FileLoadError> for VisitError

Source§

fn from(e: FileLoadError) -> Self

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for VisitError

Source§

fn from(_: FromUtf8Error) -> Self

Converts to this type from the input type.
Source§

impl<T> From<PoisonError<&mut T>> for VisitError

Source§

fn from(_: PoisonError<&mut T>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<PoisonError<MutexGuard<'_, T>>> for VisitError

Source§

fn from(_: PoisonError<MutexGuard<'_, T>>) -> Self

Converts to this type from the input type.
Source§

impl<T> From<PoisonError<RwLockWriteGuard<'_, T>>> for VisitError

Source§

fn from(_: PoisonError<RwLockWriteGuard<'_, T>>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for VisitError

Source§

fn from(s: String) -> Self

Converts to this type from the input type.

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

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

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> Downcast for T
where T: Any,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Converts self reference as a reference to Any. Could be used to downcast a trait object to a particular type.
Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

impl<T> FieldValue for T
where T: 'static,

Source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V