pub enum ConfigType {
Bool,
Int,
Uint,
String,
Tuple(Vec<ConfigType>),
Array(Box<ConfigType>),
Unknown,
}
Expand description
The supported types in the config file.
Variants§
Bool
Boolean type (bool
).
Int
Signed integer type (int
).
Uint
Unsigned integer type (uint
).
String
String type (str
).
Tuple(Vec<ConfigType>)
Tuple type (e.g., (int, str)
).
Array(Box<ConfigType>)
Array type (e.g., [int]
).
Unknown
Type is unknown.
It is used for type inference.
Implementations§
Source§impl ConfigType
impl ConfigType
Sourcepub fn new(ty: &str) -> ConfigResult<Self>
pub fn new(ty: &str) -> ConfigResult<Self>
Parses a type string into a ConfigType
.
Sourcepub fn to_rust_type(&self) -> String
pub fn to_rust_type(&self) -> String
Converts the type into a Rust type string.
Trait Implementations§
Source§impl Clone for ConfigType
impl Clone for ConfigType
Source§fn clone(&self) -> ConfigType
fn clone(&self) -> ConfigType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ConfigType
impl Debug for ConfigType
Source§impl Display for ConfigType
impl Display for ConfigType
Source§impl PartialEq for ConfigType
impl PartialEq for ConfigType
impl Eq for ConfigType
impl StructuralPartialEq for ConfigType
Auto Trait Implementations§
impl Freeze for ConfigType
impl RefUnwindSafe for ConfigType
impl Send for ConfigType
impl Sync for ConfigType
impl Unpin for ConfigType
impl UnwindSafe for ConfigType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key
and return true
if they are equal.