pub enum Value {
Show 21 variants
Boolean(bool),
Integer(i64),
Float(f64),
Bytes(Vec<u8>),
List(Vec<Value>),
Map(HashMap<String, Value>),
Null,
String(String),
Node(Node),
Relationship(Relationship),
Path(Path),
UnboundRelationship(UnboundRelationship),
Date(NaiveDate),
Time(NaiveTime, FixedOffset),
DateTimeOffset(DateTime<FixedOffset>),
DateTimeZoned(DateTime<Tz>),
LocalTime(NaiveTime),
LocalDateTime(NaiveDateTime),
Duration(Duration),
Point2D(Point2D),
Point3D(Point3D),
}Expand description
An enum that can hold values of all Bolt-compatible types.
Conversions are provided for most types, and are usually pretty intuitive (bool to
Value::Boolean, i32 to Value::Integer, HashMap to
Value::Map, etc.), but some types have no analog in Rust, like a timezone-aware time. For
such types, conversions are still provided, but may feel a bit clunky (for example, you can
convert a (NaiveTime, impl Offset) tuple into
a Value::Time).
Variants§
Boolean(bool)
Integer(i64)
Float(f64)
Bytes(Vec<u8>)
List(Vec<Value>)
Map(HashMap<String, Value>)
Null
String(String)
Node(Node)
Relationship(Relationship)
Path(Path)
UnboundRelationship(UnboundRelationship)
Date(NaiveDate)
Time(NaiveTime, FixedOffset)
DateTimeOffset(DateTime<FixedOffset>)
DateTimeZoned(DateTime<Tz>)
LocalTime(NaiveTime)
LocalDateTime(NaiveDateTime)
Duration(Duration)
Point2D(Point2D)
Point3D(Point3D)
Trait Implementations§
Source§impl From<(NaiveDateTime, Tz)> for Value
impl From<(NaiveDateTime, Tz)> for Value
Source§fn from(pair: (NaiveDateTime, Tz)) -> Self
fn from(pair: (NaiveDateTime, Tz)) -> Self
Converts to this type from the input type.
Source§impl From<NaiveDateTime> for Value
impl From<NaiveDateTime> for Value
Source§fn from(value: NaiveDateTime) -> Self
fn from(value: NaiveDateTime) -> Self
Converts to this type from the input type.
Source§impl From<Relationship> for Value
impl From<Relationship> for Value
Source§fn from(value: Relationship) -> Self
fn from(value: Relationship) -> Self
Converts to this type from the input type.
Source§impl From<UnboundRelationship> for Value
impl From<UnboundRelationship> for Value
Source§fn from(value: UnboundRelationship) -> Self
fn from(value: UnboundRelationship) -> Self
Converts to this type from the input type.
Source§impl TryFrom<Value> for DateTime<FixedOffset>
impl TryFrom<Value> for DateTime<FixedOffset>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for DateTime<Tz>
impl TryFrom<Value> for DateTime<Tz>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Duration
impl TryFrom<Value> for Duration
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl<V, S> TryFrom<Value> for HashMap<String, V, S>
impl<V, S> TryFrom<Value> for HashMap<String, V, S>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl<S> TryFrom<Value> for HashMap<String, Value, S>where
S: BuildHasher + Default,
impl<S> TryFrom<Value> for HashMap<String, Value, S>where
S: BuildHasher + Default,
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for NaiveDate
impl TryFrom<Value> for NaiveDate
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for NaiveDateTime
impl TryFrom<Value> for NaiveDateTime
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for NaiveTime
impl TryFrom<Value> for NaiveTime
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Node
impl TryFrom<Value> for Node
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Path
impl TryFrom<Value> for Path
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Point2D
impl TryFrom<Value> for Point2D
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Point3D
impl TryFrom<Value> for Point3D
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Relationship
impl TryFrom<Value> for Relationship
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for String
impl TryFrom<Value> for String
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for UnboundRelationship
impl TryFrom<Value> for UnboundRelationship
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl<T> TryFrom<Value> for Vec<T>
impl<T> TryFrom<Value> for Vec<T>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Vec<Value>
impl TryFrom<Value> for Vec<Value>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for Vec<u8>
impl TryFrom<Value> for Vec<u8>
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for bool
impl TryFrom<Value> for bool
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for f64
impl TryFrom<Value> for f64
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for i16
impl TryFrom<Value> for i16
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for i32
impl TryFrom<Value> for i32
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for i64
impl TryFrom<Value> for i64
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
Source§impl TryFrom<Value> for i8
impl TryFrom<Value> for i8
Source§type Error = ConversionError
type Error = ConversionError
The type returned in the event of a conversion error.
Source§fn try_from(value: Value) -> ConversionResult<Self>
fn try_from(value: Value) -> ConversionResult<Self>
Performs the conversion.
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
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