Enum bolt_proto::value::Value
source · 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<K, V, S> From<HashMap<K, V, S>> for Valuewhere
K: Into<String>,
V: Into<Value>,
S: BuildHasher,
impl<K, V, S> From<HashMap<K, V, S>> for Valuewhere
K: Into<String>,
V: Into<Value>,
S: BuildHasher,
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 PartialEq<Value> for Value
impl PartialEq<Value> for Value
source§impl TryFrom<Value> for DateTime<FixedOffset>
impl TryFrom<Value> for DateTime<FixedOffset>
§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>
§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
§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>where
V: TryFrom<Value, Error = ConversionError>,
S: BuildHasher + Default,
impl<V, S> TryFrom<Value> for HashMap<String, V, S>where
V: TryFrom<Value, Error = ConversionError>,
S: BuildHasher + Default,
§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,
§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
§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
§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
§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
§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
§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
§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
§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
§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
§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
§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>where
T: TryFrom<Value, Error = ConversionError>,
impl<T> TryFrom<Value> for Vec<T>where
T: TryFrom<Value, Error = ConversionError>,
§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>
§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>
§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
§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
§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
§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
§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
§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
§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.