pub enum Value {
I16(i16),
I32(i32),
I64(i64),
F64(f64),
Bool(bool),
String(String),
EntityId(EntityId),
Object(Vec<u8>),
Binary(Vec<u8>),
Json(Value),
}Variants§
I16(i16)
I32(i32)
I64(i64)
F64(f64)
Bool(bool)
String(String)
EntityId(EntityId)
Object(Vec<u8>)
Binary(Vec<u8>)
Json(Value)
JSON value - stored as jsonb in PostgreSQL for proper query support. Serialized as bytes for bincode compatibility.
Implementations§
Source§impl Value
impl Value
Sourcepub fn json<T: Serialize>(value: &T) -> Result<Self, Error>
pub fn json<T: Serialize>(value: &T) -> Result<Self, Error>
Create a Json value from any serializable type.
Sourcepub fn parse_as_json<T: DeserializeOwned>(&self) -> Result<T, PropertyError>
pub fn parse_as_json<T: DeserializeOwned>(&self) -> Result<T, PropertyError>
Parse this value as JSON into the target type. Works for Json, Object, Binary (as bytes) and String variants. Returns InvalidVariant error for numeric, bool, and EntityId types.
Sourcepub fn parse_as_string<T: FromStr>(&self) -> Result<T, PropertyError>
pub fn parse_as_string<T: FromStr>(&self) -> Result<T, PropertyError>
Parse this value as a string using FromStr. Only works for Value::String variant. Returns InvalidVariant error for other types.
Sourcepub fn extract_at_path(&self, path: &[String]) -> Option<Value>
pub fn extract_at_path(&self, path: &[String]) -> Option<Value>
Extract value at a sub-path within structured data. Returns None if the path doesn’t exist (missing - distinct from null). For empty path, returns self unchanged. Supports Json, Binary, and String (permissive for backward compat).
Trait Implementations§
Source§impl Collatable for Value
impl Collatable for Value
Source§fn successor_bytes(&self) -> Option<Vec<u8>>
fn successor_bytes(&self) -> Option<Vec<u8>>
Returns the immediate successor’s binary representation if one exists
Source§fn predecessor_bytes(&self) -> Option<Vec<u8>>
fn predecessor_bytes(&self) -> Option<Vec<u8>>
Returns the immediate predecessor’s binary representation if one exists
Source§fn is_minimum(&self) -> bool
fn is_minimum(&self) -> bool
Returns true if this value represents a minimum bound in its domain
Source§fn is_maximum(&self) -> bool
fn is_maximum(&self) -> bool
Returns true if this value represents a maximum bound in its domain
fn is_in_range( &self, lower: RangeBound<&Self>, upper: RangeBound<&Self>, ) -> bool
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
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 PartialOrd for Value
impl PartialOrd 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
Source§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
Borrows the value.
Source§fn into_taken(self) -> T
fn into_taken(self) -> T
Takes the value.