pub enum Value {
Show 19 variants
Null,
Bool(bool),
Int(Integer),
Str(String),
F32(f32),
F64(f64),
Bin(Vec<u8>),
Array(Vec<Value>),
Map(BTreeMap<String, Value>),
Timestamp(Timestamp),
Hash(Hash),
Identity(Identity),
LockId(LockId),
StreamId(StreamId),
DataLockbox(DataLockbox),
IdentityLockbox(IdentityLockbox),
StreamLockbox(StreamLockbox),
LockLockbox(LockLockbox),
BareIdKey(Box<BareIdKey>),
}Expand description
A single, self-contained fog-pack value.
This enum covers all value types that fog-pack specifically encodes.
Variants§
Null
Bool(bool)
Int(Integer)
Str(String)
F32(f32)
F64(f64)
Bin(Vec<u8>)
Array(Vec<Value>)
Map(BTreeMap<String, Value>)
Timestamp(Timestamp)
Hash(Hash)
Identity(Identity)
LockId(LockId)
StreamId(StreamId)
DataLockbox(DataLockbox)
IdentityLockbox(IdentityLockbox)
StreamLockbox(StreamLockbox)
LockLockbox(LockLockbox)
BareIdKey(Box<BareIdKey>)
Implementations§
Source§impl Value
impl Value
pub fn is_null(&self) -> bool
pub fn is_bool(&self) -> bool
pub fn is_int(&self) -> bool
pub fn is_i64(&self) -> bool
pub fn is_u64(&self) -> bool
pub fn is_f32(&self) -> bool
pub fn is_f64(&self) -> bool
pub fn is_str(&self) -> bool
pub fn is_bin(&self) -> bool
pub fn is_array(&self) -> bool
pub fn is_map(&self) -> bool
pub fn is_timestamp(&self) -> bool
pub fn is_hash(&self) -> bool
pub fn is_identity(&self) -> bool
pub fn is_stream_id(&self) -> bool
pub fn is_lock_id(&self) -> bool
pub fn is_lockbox(&self) -> bool
pub fn is_data_lockbox(&self) -> bool
pub fn is_identity_lockbox(&self) -> bool
pub fn is_stream_lockbox(&self) -> bool
pub fn is_lock_lockbox(&self) -> bool
pub fn is_bare_id_key(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn as_int(&self) -> Option<Integer>
pub fn as_i64(&self) -> Option<i64>
pub fn as_u64(&self) -> Option<u64>
pub fn as_f32(&self) -> Option<f32>
pub fn as_f64(&self) -> Option<f64>
pub fn as_floating(&self) -> Option<f64>
pub fn as_str(&self) -> Option<&str>
pub fn as_string(&self) -> Option<&String>
pub fn as_slice(&self) -> Option<&[u8]>
pub fn as_array(&self) -> Option<&[Value]>
pub fn as_array_mut(&mut self) -> Option<&mut [Value]>
pub fn as_map(&self) -> Option<&BTreeMap<String, Value>>
pub fn as_map_mut(&mut self) -> Option<&mut BTreeMap<String, Value>>
pub fn as_timestamp(&self) -> Option<Timestamp>
pub fn as_hash(&self) -> Option<&Hash>
pub fn as_identity(&self) -> Option<&Identity>
pub fn as_stream_id(&self) -> Option<&StreamId>
pub fn as_lock_id(&self) -> Option<&LockId>
pub fn as_data_lockbox(&self) -> Option<&DataLockboxRef>
pub fn as_identity_lockbox(&self) -> Option<&IdentityLockboxRef>
pub fn as_stream_lockbox(&self) -> Option<&StreamLockboxRef>
pub fn as_lock_lockbox(&self) -> Option<&LockLockboxRef>
pub fn as_bare_id_key(&self) -> Option<&BareIdKey>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<DataLockbox> for Value
impl From<DataLockbox> for Value
Source§fn from(v: DataLockbox) -> Self
fn from(v: DataLockbox) -> Self
Converts to this type from the input type.
Source§impl From<IdentityLockbox> for Value
impl From<IdentityLockbox> for Value
Source§fn from(v: IdentityLockbox) -> Self
fn from(v: IdentityLockbox) -> Self
Converts to this type from the input type.
Source§impl From<LockLockbox> for Value
impl From<LockLockbox> for Value
Source§fn from(v: LockLockbox) -> Self
fn from(v: LockLockbox) -> Self
Converts to this type from the input type.
Source§impl From<StreamLockbox> for Value
impl From<StreamLockbox> for Value
Source§fn from(v: StreamLockbox) -> Self
fn from(v: StreamLockbox) -> Self
Converts to this type from the input type.
Source§impl<V: Into<Value>> FromIterator<V> for Value
impl<V: Into<Value>> FromIterator<V> for Value
Source§fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = V>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl Index<&str> for Value
Support indexing into maps. If the index string is not in the map, this returns a
Value::Null.
impl Index<&str> for Value
Support indexing into maps. If the index string is not in the map, this returns a
Value::Null.
Source§impl Index<usize> for Value
Support indexing into arrays. If the index is out of range or the value isn’t an array, this
returns a Value::Null.
impl Index<usize> for Value
Support indexing into arrays. If the index is out of range or the value isn’t an array, this
returns a Value::Null.
Source§impl TryFrom<Value> for DataLockbox
impl TryFrom<Value> for DataLockbox
Source§impl TryFrom<Value> for IdentityLockbox
impl TryFrom<Value> for IdentityLockbox
Source§impl TryFrom<Value> for LockLockbox
impl TryFrom<Value> for LockLockbox
Source§impl TryFrom<Value> for StreamLockbox
impl TryFrom<Value> for StreamLockbox
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