Enum SpecialRustType

Source
#[non_exhaustive]
pub enum SpecialRustType {
Show 23 variants Vec(Box<RustType>), Array(Box<RustType>, usize), Slice(Box<RustType>), HashMap(Box<RustType>, Box<RustType>), Option(Box<RustType>), Unit, String, Char, I8, I16, I32, I64, U8, U16, U32, U64, ISize, USize, Bool, F32, F64, I54, U53,
}
Expand description

A special rust type that needs a manual type conversion

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Vec(Box<RustType>)

Represents Vec<T> from the standard library

§

Array(Box<RustType>, usize)

Represents [T; N] from the standard library

§

Slice(Box<RustType>)

Represents &[T] from the standard library

§

HashMap(Box<RustType>, Box<RustType>)

Represents HashMap<K, V> from the standard library

§

Option(Box<RustType>)

Represents Option<T> from the standard library

§

Unit

Represents ()

§

String

Represents String from the standard library

§

Char

Represents char

§

I8

Represents i8

§

I16

Represents i16

§

I32

Represents i32

§

I64

Represents i64

§

U8

Represents u8

§

U16

Represents u16

§

U32

Represents u32

§

U64

Represents u64

§

ISize

Represents isize

§

USize

Represents usize

§

Bool

Represents bool

§

F32

Represents f32

§

F64

Represents f64

§

I54

Represents I54 from typeshare::I54

§

U53

Represents U53 from typeshare::U53

Implementations§

Source§

impl SpecialRustType

Source

pub fn contains_type(&self, ty: &TypeName) -> bool

Check if this type is equivalent to or contains ty in one of its generic parameters. This only operates on “externally named” types; (that is, types that aren’t primitives) because it’s used only to detect the presence of generics, or that a type is recursive, or anything like that. It always returns false for things like ints and strings.

Source

pub fn parameters(&self) -> Box<dyn Iterator<Item = &RustType> + '_>

Iterate over the generic parameters for this type. Returns an empty iterator if there are none.

Trait Implementations§

Source§

impl Clone for SpecialRustType

Source§

fn clone(&self) -> SpecialRustType

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 Debug for SpecialRustType

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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, 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.