pub enum VisitError {
Show 23 variants
Multiple(Vec<VisitError>),
Io(Error),
UnknownFieldType(u8),
FieldDoesNotExist(String),
FieldAlreadyExists(String),
RegionAlreadyExists(String),
InvalidCurrentNode,
FieldTypeDoesNotMatch {
expected: &'static str,
actual: String,
},
RegionDoesNotExist(String),
NoActiveNode,
NotSupportedFormat,
InvalidName,
TypeMismatch {
expected: &'static str,
actual: &'static str,
},
RefCellAlreadyMutableBorrowed,
User(String),
UnexpectedRcNullIndex,
PoisonedMutex,
FileLoadError(FileError),
ParseIntError(ParseIntError),
ParseFloatError(ParseFloatError),
DecodeError(DecodeError),
UuidError(Error),
Any(Box<dyn Error + Send + Sync>),
}Expand description
Errors that may occur while reading or writing crate::visitor::Visitor.
Variants§
Multiple(Vec<VisitError>)
An error that occured for multiple reasons, when there are multiple potential ways to visit a node, and all of them lead to errors.
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
Current node handle is invalid and does not lead to a real node.
FieldTypeDoesNotMatch
Attempting to visit a field using a read-mode Visitor when that field was originally written using a value of a different type.
Fields
expected: &'static strexpected crate::visitor::FieldKind variant name, for instance “FieldKind::F64”
actual: StringDebug representation of actual crate::visitor::FieldKind
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 crate::Visitor::MAGIC_BINARY_CURRENT, crate::Visitor::MAGIC_ASCII_CURRENT.
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.
Fields
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(FileError)
A FileLoadError was encountered while trying to decode Visitor data from a file.
ParseIntError(ParseIntError)
Integer parsing error.
ParseFloatError(ParseFloatError)
Floating point number parsing error.
DecodeError(DecodeError)
An error occurred when trying to decode base64-encoded data.
UuidError(Error)
An error occurred when trying to parse uuid from a string.
Any(Box<dyn Error + Send + Sync>)
Arbitrary error.
Implementations§
Source§impl VisitError
impl VisitError
Sourcepub fn field_does_not_exist(name: &str, visitor: &Visitor) -> VisitError
pub fn field_does_not_exist(name: &str, visitor: &Visitor) -> VisitError
Create a VisitError::FieldDoesNotExist containing the given field name and the
breadcrumbs of the current visitor node.
Sourcepub fn multiple(self, other: VisitError) -> VisitError
pub fn multiple(self, other: VisitError) -> VisitError
Create an error from two errors.
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<DecodeError> for VisitError
impl From<DecodeError> for VisitError
Source§fn from(value: DecodeError) -> VisitError
fn from(value: DecodeError) -> VisitError
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<Error> for VisitError
impl From<Error> for VisitError
Source§fn from(value: Error) -> VisitError
fn from(value: Error) -> VisitError
Source§impl From<FileError> for VisitError
impl From<FileError> for VisitError
Source§fn from(e: FileError) -> VisitError
fn from(e: FileError) -> VisitError
Source§impl From<FromUtf8Error> for VisitError
impl From<FromUtf8Error> for VisitError
Source§fn from(_: FromUtf8Error) -> VisitError
fn from(_: FromUtf8Error) -> VisitError
Source§impl From<ParseFloatError> for VisitError
impl From<ParseFloatError> for VisitError
Source§fn from(value: ParseFloatError) -> VisitError
fn from(value: ParseFloatError) -> VisitError
Source§impl From<ParseIntError> for VisitError
impl From<ParseIntError> for VisitError
Source§fn from(value: ParseIntError) -> VisitError
fn from(value: ParseIntError) -> 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 GameError
impl From<VisitError> for GameError
Source§fn from(value: VisitError) -> Self
fn from(value: VisitError) -> Self
Source§impl From<VisitError> for MaterialError
impl From<VisitError> for MaterialError
Source§fn from(value: VisitError) -> MaterialError
fn from(value: VisitError) -> MaterialError
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 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>, which can then be
downcast into Box<dyn 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>, which 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> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§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.