#[non_exhaustive]pub enum SpecialRustType {
}Expand description
A special rust type that needs a manual type conversion
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
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
impl SpecialRustType
Sourcepub fn contains_type(&self, ty: &TypeName) -> bool
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.
Sourcepub fn parameters(&self) -> Box<dyn Iterator<Item = &RustType> + '_>
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
impl Clone for SpecialRustType
Source§fn clone(&self) -> SpecialRustType
fn clone(&self) -> SpecialRustType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SpecialRustType
impl RefUnwindSafe for SpecialRustType
impl Send for SpecialRustType
impl Sync for SpecialRustType
impl Unpin for SpecialRustType
impl UnwindSafe for SpecialRustType
Blanket Implementations§
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more