Enum Ty
pub enum Ty {
Show 22 variants
Unit,
U8,
U16,
U32,
U64,
I8,
I16,
I32,
I64,
F32,
F64,
String,
Bool,
Pointer(Box<Ty>),
Option(Box<Ty>),
Array {
item: Box<Ty>,
len: usize,
},
Slice(Box<Ty>),
Tuple(Vec<Ty>),
RefRo(Box<Ty>),
RefMut(Box<Ty>),
Struct {
name: String,
args: Vec<Ty>,
},
Enum {
name: String,
args: Vec<Ty>,
},
}Expand description
Semantic type assigned by checking and consumed by lower IRs/backends.
Variants§
Unit
The unit type.
U8
Unsigned 8-bit integer type.
U16
Unsigned 16-bit integer type.
U32
Unsigned 32-bit integer type.
U64
Unsigned 64-bit integer type.
I8
Signed 8-bit integer type.
I16
Signed 16-bit integer type.
I32
Signed 32-bit integer type.
I64
Signed 64-bit integer type.
F32
32-bit floating-point type.
F64
64-bit floating-point type.
String
The string value type.
Bool
The boolean type.
Pointer(Box<Ty>)
Nullable owned pointer to another type.
Option(Box<Ty>)
Optional value.
Array
Fixed-size array of items.
Slice(Box<Ty>)
Borrowed slice of items.
Tuple(Vec<Ty>)
Tuple of positional elements.
RefRo(Box<Ty>)
Read-only reference to another type.
RefMut(Box<Ty>)
Mutable reference to another type.
Struct
Struct type with optional concrete type arguments.
Fields
Enum
Enum type with optional concrete type arguments.
Implementations§
§impl Ty
impl Ty
pub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Return whether this is a scalar integer type.
pub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Return whether this is any scalar numeric type.
Trait Implementations§
§impl Ord for Ty
impl Ord for Ty
§impl PartialOrd for Ty
impl PartialOrd for Ty
impl Eq for Ty
impl StructuralPartialEq for Ty
Auto Trait Implementations§
impl Freeze for Ty
impl RefUnwindSafe for Ty
impl Send for Ty
impl Sync for Ty
impl Unpin for Ty
impl UnwindSafe for Ty
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.