[−][src]Enum gdnative::prelude::FromVariantError
Error type returned by FromVariant::from_variant
.
Variants
An unspecified error.
Custom(String)
A custom error message.
Null value given for a non-nullable type, with no further information given.
Variant type is different from the expected one.
Fields of InvalidVariantType
variant_type: VariantType
expected: VariantType
Cannot cast the object to the given Godot class.
Length of the collection is different from the expected one.
Invalid enum representation.
Fields of InvalidEnumRepr
expected: VariantEnumRepr
error: Box<FromVariantError>
Invalid struct representation.
Fields of InvalidStructRepr
expected: VariantStructRepr
error: Box<FromVariantError>
Error indicating that the implementation encountered an enum variant that does not exist at compile time.
For example, trying to create a Result<T, E>
from { "Foo": "Bar" }
will result in this
error, since Foo
is not a valid variant of Result
.
Fields of UnknownEnumVariant
variant: String
Name of the unknown variant
expected: &'static [&'static str]
Names of all expected variants known at compile time
Error indicating that the implementation encountered a known enum variant, but the value is invalid for the definition.
This could result from multiple underlying reasons, detailed in the error
field:
- Missing fields.
- Unexpected representation, e.g.
{ "0": "foo", "1": "bar" }
for a tuple. - Error in a nested field.
Fields of InvalidEnumVariant
variant: &'static str
error: Box<FromVariantError>
Given object is not an instance of the expected NativeClass.
Fields of InvalidInstance
expected: &'static str
Collection contains an invalid field.
Fields of InvalidField
field_name: &'static str
error: Box<FromVariantError>
Collection contains an invalid item.
Fields of InvalidItem
index: usize
error: Box<FromVariantError>
Implementations
impl FromVariantError
[src]
pub fn custom<T>(message: T) -> FromVariantError where
T: Display,
[src]
T: Display,
Returns a FromVariantError
with a custom message.
Trait Implementations
impl Clone for FromVariantError
[src]
fn clone(&self) -> FromVariantError
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for FromVariantError
[src]
impl Display for FromVariantError
[src]
impl Eq for FromVariantError
[src]
impl Error for FromVariantError
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
1.30.0[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn description(&self) -> &str
1.0.0[src]
fn cause(&self) -> Option<&dyn Error>
1.0.0[src]
impl PartialEq<FromVariantError> for FromVariantError
[src]
fn eq(&self, other: &FromVariantError) -> bool
[src]
fn ne(&self, other: &FromVariantError) -> bool
[src]
impl StructuralEq for FromVariantError
[src]
impl StructuralPartialEq for FromVariantError
[src]
Auto Trait Implementations
impl RefUnwindSafe for FromVariantError
impl Send for FromVariantError
impl Sync for FromVariantError
impl Unpin for FromVariantError
impl UnwindSafe for FromVariantError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,