Enum csvenum::SpecialType
source · pub enum SpecialType {
Enum(String),
Regex,
Bool,
}
Expand description
Special types have vastly different behaviour than the other types and can not be directly inferred from a string representation (except for bool).
Variants§
Enum(String)
Regex
Bool
When a property is of type singular bool then collect all variants with true and false as const array and return as Vec in match function
Trait Implementations§
source§impl Debug for SpecialType
impl Debug for SpecialType
source§impl PartialEq for SpecialType
impl PartialEq for SpecialType
source§fn eq(&self, other: &SpecialType) -> bool
fn eq(&self, other: &SpecialType) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl RTypeTrait for SpecialType
impl RTypeTrait for SpecialType
source§fn is_const(&self) -> bool
fn is_const(&self) -> bool
Not applicable to enum since enums const be decalred as const or static, but as enum MyEnum {…}
Regex require OnceLock so they are definitely not const
source§fn value_is_valid(&self, valuestr: &str) -> bool
fn value_is_valid(&self, valuestr: &str) -> bool
For enums, values are variants, so the Rust syntax rules for Enum variants apply, it could also have the name of the enum prefixed
For Regex, values are r““ that contain weird characters, so take anything as valid i guess… but when get_or_init’ing the OnceLock
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,
Construct the RType from a string that contains type information i.e. “ &str “ Read more
source§fn to_typestr(&self) -> String
fn to_typestr(&self) -> String
Conversions into type representation Read more
source§fn to_typestr_no_ref(&self) -> String
fn to_typestr_no_ref(&self) -> String
get representation without references or lifetimes
str
source§fn to_typestr_no_life(&self) -> String
fn to_typestr_no_life(&self) -> String
get representation without lifetime
&str
source§fn collect_lifetimes(&self, into: &mut Vec<String>)
fn collect_lifetimes(&self, into: &mut Vec<String>)
collect lifetimes
source§fn get_breadth(&self, counter: usize) -> usize
fn get_breadth(&self, counter: usize) -> usize
Get nesting breadth
fn wrap_valuestr(&self, valuestr: &str) -> String
source§fn can_match_as_key(&self) -> bool
fn can_match_as_key(&self) -> bool
Whether the type can be used as the key in a match expression, floats can not.
impl Eq for SpecialType
impl StructuralPartialEq for SpecialType
Auto Trait Implementations§
impl Freeze for SpecialType
impl RefUnwindSafe for SpecialType
impl Send for SpecialType
impl Sync for SpecialType
impl Unpin for SpecialType
impl UnwindSafe for SpecialType
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
Mutably borrows from an owned value. Read more