pub enum ReflectError {
Show 23 variants
NoSuchVariant {
enum_type: EnumType,
},
WrongShape {
expected: &'static Shape,
actual: &'static Shape,
},
WasNotA {
expected: &'static str,
actual: &'static Shape,
},
UninitializedField {
shape: &'static Shape,
field_name: &'static str,
},
UninitializedEnumField {
shape: &'static Shape,
field_name: &'static str,
variant_name: &'static str,
},
UninitializedValue {
shape: &'static Shape,
},
InvariantViolation {
invariant: &'static str,
},
MissingCharacteristic {
shape: &'static Shape,
characteristic: Characteristic,
},
OperationFailed {
shape: &'static Shape,
operation: &'static str,
},
FieldError {
shape: &'static Shape,
field_error: FieldError,
},
MissingPushPointee {
shape: &'static Shape,
},
Unknown,
TryFromError {
src_shape: &'static Shape,
dst_shape: &'static Shape,
inner: TryFromError,
},
DefaultAttrButNoDefaultImpl {
shape: &'static Shape,
},
Unsized {
shape: &'static Shape,
operation: &'static str,
},
ArrayNotFullyInitialized {
shape: &'static Shape,
pushed_count: usize,
expected_size: usize,
},
ArrayIndexOutOfBounds {
shape: &'static Shape,
index: usize,
size: usize,
},
InvalidOperation {
operation: &'static str,
reason: &'static str,
},
UnexpectedTracker {
message: &'static str,
current_tracker: TrackerKind,
},
NoActiveFrame,
HeistCancelledDifferentShapes {
src_shape: &'static Shape,
dst_shape: &'static Shape,
},
CustomDeserializationError {
message: String,
src_shape: &'static Shape,
dst_shape: &'static Shape,
},
CustomSerializationError {
message: String,
src_shape: &'static Shape,
dst_shape: &'static Shape,
},
}Expand description
Errors that can occur when reflecting on types.
Variants§
NoSuchVariant
Tried to set an enum to a variant that does not exist
WrongShape
Tried to get the wrong shape out of a value — e.g. we were manipulating
a String, but .get() was called with a u64 or something.
Fields
WasNotA
Attempted to perform an operation that expected a struct or something
Fields
UninitializedField
A field was not initialized during build
Fields
UninitializedEnumField
A field in an enum variant was not initialized during build
Fields
UninitializedValue
A scalar value was not initialized during build
InvariantViolation
An invariant of the reflection system was violated.
MissingCharacteristic
Attempted to set a value to its default, but the value doesn’t implement Default.
Fields
characteristic: CharacteristicThe characteristic that is missing.
OperationFailed
An operation failed for a given shape
Fields
FieldError
An error occurred when attempting to access or modify a field.
Fields
field_error: FieldErrorThe specific error that occurred with the field.
MissingPushPointee
Indicates that we try to access a field on an Arc<T>, for example, and the field might exist
on the T, but you need to do begin_smart_ptr first when using the WIP API.
Unknown
An unknown error occurred.
TryFromError
An error occured while putting
Fields
inner: TryFromErrorThe inner error
DefaultAttrButNoDefaultImpl
A shape has a default attribute, but no implementation of the Default trait.
Fields
Unsized
The type is unsized
Fields
ArrayNotFullyInitialized
Array not fully initialized during build
Fields
ArrayIndexOutOfBounds
Array index out of bounds
Fields
InvalidOperation
Invalid operation for the current state
Fields
UnexpectedTracker
Unexpected tracker state when performing a reflection operation
Fields
current_tracker: TrackerKindThe current tracker set for this frame
NoActiveFrame
No active frame in Partial
HeistCancelledDifferentShapes
steal_nth_field only works if the dst and src shapes are the same.
Fields
CustomDeserializationError
Error during custom deserialization
Fields
CustomSerializationError
Error during custom serialization
Trait Implementations§
Source§impl Clone for ReflectError
impl Clone for ReflectError
Source§fn clone(&self) -> ReflectError
fn clone(&self) -> ReflectError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more