pub enum LogicalType {
Show 21 variants
Any,
Null,
Bool,
Int8,
Int16,
Int32,
Int64,
Float32,
Float64,
String,
Bytes,
Date,
Time,
Timestamp,
Duration,
List(Box<LogicalType>),
Map {
key: Box<LogicalType>,
value: Box<LogicalType>,
},
Struct(Vec<(String, LogicalType)>),
Node,
Edge,
Path,
}Expand description
Logical type for values in Grafeo.
These types correspond to the GQL/Cypher type system and are used for:
- Schema definitions (column types in node/edge tables)
- Query type checking
- Value coercion rules
Variants§
Any
Unknown or any type (used during type inference)
Null
Null type (only value is NULL)
Bool
Boolean type
Int8
8-bit signed integer
Int16
16-bit signed integer
Int32
32-bit signed integer
Int64
64-bit signed integer
Float32
32-bit floating point
Float64
64-bit floating point
String
Variable-length UTF-8 string
Bytes
Binary data
Date
Date (year, month, day)
Time
Time (hour, minute, second, nanosecond)
Timestamp
Timestamp with timezone
Duration
Duration/interval
List(Box<LogicalType>)
Homogeneous list of elements
Map
Key-value map
Fields
key: Box<LogicalType>Type of map keys (usually String)
value: Box<LogicalType>Type of map values
Struct(Vec<(String, LogicalType)>)
Struct with named fields
Node
Node reference
Edge
Edge reference
Path
Path (sequence of nodes and edges)
Implementations§
Source§impl LogicalType
impl LogicalType
Sourcepub const fn is_numeric(&self) -> bool
pub const fn is_numeric(&self) -> bool
Returns true if this type is numeric (integer or floating point).
Sourcepub const fn is_integer(&self) -> bool
pub const fn is_integer(&self) -> bool
Returns true if this type is an integer type.
Sourcepub const fn is_temporal(&self) -> bool
pub const fn is_temporal(&self) -> bool
Returns true if this type is a temporal type.
Sourcepub const fn is_graph_element(&self) -> bool
pub const fn is_graph_element(&self) -> bool
Returns true if this type is a graph element type.
Sourcepub const fn is_nullable(&self) -> bool
pub const fn is_nullable(&self) -> bool
Returns true if this type is nullable (can hold NULL values).
In Grafeo, all types except Null itself are nullable by default.
Sourcepub fn list_element_type(&self) -> Option<&LogicalType>
pub fn list_element_type(&self) -> Option<&LogicalType>
Returns the element type if this is a List, otherwise None.
Sourcepub fn can_coerce_from(&self, other: &LogicalType) -> bool
pub fn can_coerce_from(&self, other: &LogicalType) -> bool
Checks if a value of other type can be implicitly coerced to this type.
Sourcepub fn common_type(&self, other: &LogicalType) -> Option<LogicalType>
pub fn common_type(&self, other: &LogicalType) -> Option<LogicalType>
Returns the common supertype of two types, if one exists.
Trait Implementations§
Source§impl Clone for LogicalType
impl Clone for LogicalType
Source§fn clone(&self) -> LogicalType
fn clone(&self) -> LogicalType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalType
impl Debug for LogicalType
Source§impl Default for LogicalType
impl Default for LogicalType
Source§impl<'de> Deserialize<'de> for LogicalType
impl<'de> Deserialize<'de> for LogicalType
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>,
Source§impl Display for LogicalType
impl Display for LogicalType
Source§impl Hash for LogicalType
impl Hash for LogicalType
Source§impl PartialEq for LogicalType
impl PartialEq for LogicalType
Source§impl Serialize for LogicalType
impl Serialize for LogicalType
impl Eq for LogicalType
impl StructuralPartialEq for LogicalType
Auto Trait Implementations§
impl Freeze for LogicalType
impl RefUnwindSafe for LogicalType
impl Send for LogicalType
impl Sync for LogicalType
impl Unpin for LogicalType
impl UnwindSafe for LogicalType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.