pub enum RType {
Numeric(Reference, NumericType),
String(Reference, StringType),
Container(Reference, ContainerType),
Special(Reference, SpecialType),
}
Expand description
Rust Type primitive (no value or name attached, except for enum), has functions for:
-
constructing itself from a given string that should contain type information.
-
validation of values.
-
gathering of information (can be const, has lifetimes, etc.).
-
formatting passed values.
Its variants contain the actual type and an optional Reference
Numeric -> NumericType
String -> StringType
Container -> ContainerType
Special -> SpecialType
Variants§
Numeric(Reference, NumericType)
Any Numeric Type
String(Reference, StringType)
Any String Type
Container(Reference, ContainerType)
Any Container Type, except for Option and Result
Special(Reference, SpecialType)
Special Types that need special treatment, very special incl:
Regex
Enum
Bool (not that special actually but easy to find)
Implementations§
source§impl RType
impl RType
pub fn get_refstr(&self) -> String
pub fn get_refstr_no_life(&self) -> String
pub fn get_lifetime(&self) -> String
pub fn has_lifetime(&self) -> bool
Trait Implementations§
source§impl PartialEq for RType
impl PartialEq for RType
source§impl RTypeTrait for RType
impl RTypeTrait for RType
source§fn from_typestr<T: AsRef<str>>(typestr: T) -> Result<Self, TypeError>where
Self: Sized,
fn from_typestr<T: AsRef<str>>(typestr: T) -> Result<Self, TypeError>where
Self: Sized,
Call this function to parse the complete type information from a string representation
source§fn is_const(&self) -> bool
fn is_const(&self) -> bool
Container of type tuple will not be const when it contains non-const types
source§fn to_typestr(&self) -> String
fn to_typestr(&self) -> String
source§fn to_typestr_no_ref(&self) -> String
fn to_typestr_no_ref(&self) -> String
str
source§fn to_typestr_no_life(&self) -> String
fn to_typestr_no_life(&self) -> String
&str