pub enum SimpleType {
String,
Int,
Float,
Bool,
Mixed,
Null,
Void,
Never,
Complex(Box<Union>),
}Variants§
String
Int
Float
Bool
Mixed
Null
Void
Never
Complex(Box<Union>)
Complex types (multi-union, type args, etc.) are boxed.
Implementations§
Source§impl SimpleType
impl SimpleType
Sourcepub fn from_union(u: Union) -> Self
pub fn from_union(u: Union) -> Self
Convert a Union into a SimpleType, boxing complex types.
Sourcepub fn as_complex(&self) -> Option<&Union>
pub fn as_complex(&self) -> Option<&Union>
Get as a Union reference if Complex, or None if simple.
Trait Implementations§
Source§impl Clone for SimpleType
impl Clone for SimpleType
Source§fn clone(&self) -> SimpleType
fn clone(&self) -> SimpleType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SimpleType
impl Debug for SimpleType
Source§impl<'de> Deserialize<'de> for SimpleType
impl<'de> Deserialize<'de> for SimpleType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for SimpleType
impl Display for SimpleType
Source§impl PartialEq for SimpleType
impl PartialEq for SimpleType
Source§fn eq(&self, other: &SimpleType) -> bool
fn eq(&self, other: &SimpleType) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for SimpleType
impl Serialize for SimpleType
impl StructuralPartialEq for SimpleType
Auto Trait Implementations§
impl Freeze for SimpleType
impl RefUnwindSafe for SimpleType
impl Send for SimpleType
impl Sync for SimpleType
impl Unpin for SimpleType
impl UnsafeUnpin for SimpleType
impl UnwindSafe for SimpleType
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