Enum Unexpected

Source
pub enum Unexpected<'a> {
Show 30 variants Void, Bool(bool), Char(char), Int8(i8), Uint8(u8), Int16(i16), Uint16(u16), Int32(i32), Uint32(u32), Int64(i64), Uint64(u64), Real(f32), Vector4(Vector4), Quaternion(Quaternion), Matrix3(Matrix3), Rotation(Rotation), QsTransform(QsTransform), Matrix4(Matrix4), Transform(Transform), Pointer(Pointer), Array, Enum, Struct, Variant(Variant), CString(CString<'a>), Ulong(Ulong), Flags, Half(f16), StringPtr(StringPtr<'a>), Other(&'a str),
}
Expand description

Unexpected represents an unexpected invocation of any one of the Visitor trait methods.

This is used as an argument to the invalid_type, invalid_value, and invalid_length methods of the Error trait to build error messages.

Variants§

§

Void

No type information.

  • C++ type: void

§Examples

This is often used to fill in generics elements with types for which generics are not used.

  • hkArray<hkBool> -> vtype: TYPE_ARRAY, vsubtype: TYPE_BOOL
  • hkBool -> vtype: TYPE_BOOL, vsubtype: TYPE_VOID
  • There is also a pattern hkArray<void>. The type information is unknown, but this member always contains the SERIALIZE_IGNORED flag and can be skipped.
§

Bool(bool)

  • C++ type: hkBool (bool)
§

Char(char)

  • C++ type: hkChar (signed char)
§

Int8(i8)

  • C++ type: hkInt8 (signed char)
§

Uint8(u8)

  • C++ type: hkUint8 (unsigned char)
§

Int16(i16)

  • C++ type: hkInt16 (signed short)
§

Uint16(u16)

  • C++ type: hkUint16 (unsigned short)
§

Int32(i32)

  • C++ type: hkInt32 (signed int)
§

Uint32(u32)

  • C++ type: hkUint32 (unsigned int)
§

Int64(i64)

  • C++ type: hkInt64 (signed long long)
§

Uint64(u64)

  • C++ type: hkUint64 (unsigned long long)
§

Real(f32)

  • C++ type: hkReal (float)
§

Vector4(Vector4)

  • C++ type: hkVector4
§

Quaternion(Quaternion)

  • C++ type: hkQuaternion
§

Matrix3(Matrix3)

  • C++ type: hkMatrix3
§

Rotation(Rotation)

  • C++ type: hkRotation
§

QsTransform(QsTransform)

  • C++ type: hkQsTransform
§

Matrix4(Matrix4)

  • C++ type: hkMatrix4
§

Transform(Transform)

  • C++ type: hkTransform
§

Pointer(Pointer)

  • C++ type: T*
§

Array

Array of items of type T.

  • C++ type: hkArray<T>
§

Enum

enum type that stores only the size of SizeType in memory.

  • C++ type: hkEnum<Enum,SizeType>
§

Struct

  • C++ type: class | struct
§

Variant(Variant)

  • C++ type: hkVariant (void* and hkClass*) type
§

CString(CString<'a>)

Null terminated string.

  • C++ type: char*
§

Ulong(Ulong)

  • C++ type: hkUlong (unsigned long), defined to always be the same size as a pointer
§

Flags

  • C++ type: hkFlags<ENUM, SizeType> - 8,16,32 bits of named values.
§

Half(f16)

  • C++ type: hkHalf (hkInt16), 16-bit float value
§

StringPtr(StringPtr<'a>)

Null-terminated string type.

There is a flag StringFlags::OWNED_FLAG = 0x1 defined in the class, so Owned is also possible.

It is unclear which segment (stack, heap, or other) is being pointed to because of the raw pointer.

  • C++ type: hkStringPtr
§

Other(&'a str)

Other types

Trait Implementations§

Source§

impl<'a> Clone for Unexpected<'a>

Source§

fn clone(&self) -> Unexpected<'a>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Unexpected<'a>

Source§

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

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

impl Display for Unexpected<'_>

Source§

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

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

impl<'a> PartialEq for Unexpected<'a>

Source§

fn eq(&self, other: &Unexpected<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for Unexpected<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for Unexpected<'a>

§

impl<'a> RefUnwindSafe for Unexpected<'a>

§

impl<'a> Send for Unexpected<'a>

§

impl<'a> Sync for Unexpected<'a>

§

impl<'a> Unpin for Unexpected<'a>

§

impl<'a> UnwindSafe for Unexpected<'a>

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoResult<T> for T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.