pub enum PrimitiveKind {
Number,
Integer,
PositiveInteger,
String,
Iterable(Box<PrimitiveKind>),
Graph,
GraphEdge,
GraphNode,
Tuple(Vec<PrimitiveKind>),
Boolean,
Undefined,
Any,
}Variants§
Number
Floating point number type
Integer
Signed integer type
PositiveInteger
Unsigned integer type
String
String type
Iterable(Box<PrimitiveKind>)
Iterable type containing elements of the specified kind
Graph
Graph type
GraphEdge
Graph edge type
GraphNode
Graph node type
Tuple(Vec<PrimitiveKind>)
Tuple type containing a sequence of primitive kinds
Boolean
Boolean type
Undefined
Undefined type
Any
Any type (used for type checking)
Implementations§
Source§impl PrimitiveKind
impl PrimitiveKind
Sourcepub fn from_primitive(p: &Primitive) -> Self
pub fn from_primitive(p: &Primitive) -> Self
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Checks if the type is numeric (Number, Integer, PositiveInteger, or Boolean).
pub fn is_any(&self) -> bool
pub fn is_iterable(&self) -> bool
Sourcepub fn can_spread_into(&self) -> Result<Vec<PrimitiveKind>, TransformError>
pub fn can_spread_into(&self) -> Result<Vec<PrimitiveKind>, TransformError>
Returns the types that this primitive kind can be spread into.
§Returns
Ok(Vec<PrimitiveKind>)- The types this kind can be spread intoErr(TransformError)- If the type cannot be spread
pub fn can_apply_binary_op(&self, op: BinOp, to: PrimitiveKind) -> bool
pub fn can_apply_unary_op(&self, op: UnOp) -> bool
Trait Implementations§
Source§impl Clone for PrimitiveKind
impl Clone for PrimitiveKind
Source§fn clone(&self) -> PrimitiveKind
fn clone(&self) -> PrimitiveKind
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 PrimitiveKind
impl Debug for PrimitiveKind
Source§impl<'de> Deserialize<'de> for PrimitiveKind
impl<'de> Deserialize<'de> for PrimitiveKind
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 PrimitiveKind
impl Display for PrimitiveKind
Source§impl PartialEq for PrimitiveKind
impl PartialEq for PrimitiveKind
Source§impl Serialize for PrimitiveKind
impl Serialize for PrimitiveKind
impl StructuralPartialEq for PrimitiveKind
Auto Trait Implementations§
impl Freeze for PrimitiveKind
impl RefUnwindSafe for PrimitiveKind
impl Send for PrimitiveKind
impl Sync for PrimitiveKind
impl Unpin for PrimitiveKind
impl UnsafeUnpin for PrimitiveKind
impl UnwindSafe for PrimitiveKind
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,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more