pub enum RustType {
Slice(Rc<TypeInfo>),
Array(Rc<Array>),
Tuple(Rc<[TypeInfo]>),
Option(Rc<TypeInfo>),
Box(Rc<TypeInfo>),
Vec(Rc<TypeInfo>),
HashMap((Rc<TypeInfo>, Rc<TypeInfo>)),
Other(Rc<TypePath>),
}Variants§
Slice(Rc<TypeInfo>)
Array(Rc<Array>)
Tuple(Rc<[TypeInfo]>)
Option(Rc<TypeInfo>)
Box(Rc<TypeInfo>)
Vec(Rc<TypeInfo>)
HashMap((Rc<TypeInfo>, Rc<TypeInfo>))
Other(Rc<TypePath>)
Implementations§
Source§impl RustType
impl RustType
Sourcepub fn is_hash_map(&self) -> bool
pub fn is_hash_map(&self) -> bool
Returns true if the rust type is HashMap.
pub fn as_option(&self) -> Option<&TypeInfo>
pub fn as_slice(&self) -> Option<&TypeInfo>
pub fn as_tuple(&self) -> Option<&[TypeInfo]>
pub fn as_box(&self) -> Option<&TypeInfo>
pub fn as_vec(&self) -> Option<&TypeInfo>
pub fn as_hash_map(&self) -> Option<&(Rc<TypeInfo>, Rc<TypeInfo>)>
pub fn as_other(&self) -> Option<&TypePath>
pub fn as_array(&self) -> Option<&Array>
Trait Implementations§
Source§impl ToTokens for RustType
impl ToTokens for RustType
Source§fn to_tokens(&self, tokens: &mut TokenStream2)
fn to_tokens(&self, tokens: &mut TokenStream2)
Source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
Source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for RustType
impl StructuralPartialEq for RustType
Auto Trait Implementations§
impl Freeze for RustType
impl RefUnwindSafe for RustType
impl !Send for RustType
impl !Sync for RustType
impl Unpin for RustType
impl UnwindSafe for RustType
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)Source§impl<T> Spanned for Twhere
T: Spanned + ?Sized,
impl<T> Spanned for Twhere
T: Spanned + ?Sized,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span covering the complete contents of this syntax tree
node, or Span::call_site() if this node is empty.