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
impl Debug for VisitError
Source§impl Display for VisitError
impl Display for VisitError
Source§impl Error for VisitError
impl Error for VisitError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Error> for VisitError
impl From<Error> for VisitError
Source§fn from(io_err: Error) -> VisitError
fn from(io_err: Error) -> VisitError
Source§impl From<FileLoadError> for VisitError
impl From<FileLoadError> for VisitError
Source§fn from(e: FileLoadError) -> VisitError
fn from(e: FileLoadError) -> VisitError
Source§impl From<FromUtf8Error> for VisitError
impl From<FromUtf8Error> for VisitError
Source§fn from(_: FromUtf8Error) -> VisitError
fn from(_: FromUtf8Error) -> VisitError
Source§impl<T> From<PoisonError<&mut T>> for VisitError
impl<T> From<PoisonError<&mut T>> for VisitError
Source§fn from(_: PoisonError<&mut T>) -> VisitError
fn from(_: PoisonError<&mut T>) -> VisitError
Source§impl<T> From<PoisonError<MutexGuard<'_, T>>> for VisitError
impl<T> From<PoisonError<MutexGuard<'_, T>>> for VisitError
Source§fn from(_: PoisonError<MutexGuard<'_, T>>) -> VisitError
fn from(_: PoisonError<MutexGuard<'_, T>>) -> VisitError
Source§impl<T> From<PoisonError<RwLockWriteGuard<'_, T>>> for VisitError
impl<T> From<PoisonError<RwLockWriteGuard<'_, T>>> for VisitError
Source§fn from(_: PoisonError<RwLockWriteGuard<'_, T>>) -> VisitError
fn from(_: PoisonError<RwLockWriteGuard<'_, T>>) -> VisitError
Source§impl From<String> for VisitError
impl From<String> for VisitError
Source§fn from(s: String) -> VisitError
fn from(s: String) -> VisitError
Source§impl From<VisitError> for CurveResourceError
impl From<VisitError> for CurveResourceError
Source§fn from(e: VisitError) -> Self
fn from(e: VisitError) -> Self
Source§impl From<VisitError> for MaterialError
impl From<VisitError> for MaterialError
Source§fn from(value: VisitError) -> Self
fn from(value: VisitError) -> Self
Source§impl From<VisitError> for ModelLoadError
impl From<VisitError> for ModelLoadError
Source§fn from(e: VisitError) -> Self
fn from(e: VisitError) -> Self
Source§impl From<VisitError> for StyleResourceError
impl From<VisitError> for StyleResourceError
Source§fn from(e: VisitError) -> StyleResourceError
fn from(e: VisitError) -> StyleResourceError
Source§impl From<VisitError> for TileMapBrushResourceError
impl From<VisitError> for TileMapBrushResourceError
Source§fn from(e: VisitError) -> Self
fn from(e: VisitError) -> Self
Source§impl From<VisitError> for TileSetResourceError
impl From<VisitError> for TileSetResourceError
Source§fn from(e: VisitError) -> Self
fn from(e: VisitError) -> Self
Auto Trait Implementations§
impl Freeze for VisitError
impl !RefUnwindSafe for VisitError
impl Send for VisitError
impl Sync for VisitError
impl Unpin for VisitError
impl !UnwindSafe for VisitError
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ScriptMessagePayload for T
impl<T> ScriptMessagePayload for T
Source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
self as &dyn AnySource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
self as &dyn AnySource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.