pub enum ValueRef<'a> {
Show 19 variants
Null,
Bool(bool),
Int(Integer),
Str(&'a str),
F32(f32),
F64(f64),
Bin(&'a [u8]),
Array(Vec<ValueRef<'a>>),
Map(BTreeMap<&'a str, ValueRef<'a>>),
Hash(Hash),
Identity(Identity),
StreamId(StreamId),
LockId(LockId),
Timestamp(Timestamp),
DataLockbox(&'a DataLockboxRef),
IdentityLockbox(&'a IdentityLockboxRef),
StreamLockbox(&'a StreamLockboxRef),
LockLockbox(&'a LockLockboxRef),
BareIdKey(Box<BareIdKey>),
}
Expand description
A single fog-pack value, built using references to underlying data as much as possible.
This enum covers all value types that fog-pack specifically encodes.
Variants§
Null
Bool(bool)
Int(Integer)
Str(&'a str)
F32(f32)
F64(f64)
Bin(&'a [u8])
Array(Vec<ValueRef<'a>>)
Map(BTreeMap<&'a str, ValueRef<'a>>)
Hash(Hash)
Identity(Identity)
StreamId(StreamId)
LockId(LockId)
Timestamp(Timestamp)
DataLockbox(&'a DataLockboxRef)
IdentityLockbox(&'a IdentityLockboxRef)
StreamLockbox(&'a StreamLockboxRef)
LockLockbox(&'a LockLockboxRef)
BareIdKey(Box<BareIdKey>)
Implementations§
Source§impl<'a> ValueRef<'a>
impl<'a> ValueRef<'a>
pub fn to_owned(&self) -> 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_bin(&self) -> Option<&[u8]>
pub fn as_array(&self) -> Option<&[ValueRef<'a>]>
pub fn as_array_mut(&mut self) -> Option<&mut [ValueRef<'a>]>
pub fn as_map(&self) -> Option<&BTreeMap<&'a str, ValueRef<'a>>>
pub fn as_map_mut(&mut self) -> Option<&mut BTreeMap<&'a str, ValueRef<'a>>>
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 ValueRef<'de>
impl<'de> Deserialize<'de> for ValueRef<'de>
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<'a> From<&'a DataLockboxRef> for ValueRef<'a>
impl<'a> From<&'a DataLockboxRef> for ValueRef<'a>
Source§fn from(v: &'a DataLockboxRef) -> Self
fn from(v: &'a DataLockboxRef) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a IdentityLockboxRef> for ValueRef<'a>
impl<'a> From<&'a IdentityLockboxRef> for ValueRef<'a>
Source§fn from(v: &'a IdentityLockboxRef) -> Self
fn from(v: &'a IdentityLockboxRef) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a LockLockboxRef> for ValueRef<'a>
impl<'a> From<&'a LockLockboxRef> for ValueRef<'a>
Source§fn from(v: &'a LockLockboxRef) -> Self
fn from(v: &'a LockLockboxRef) -> Self
Converts to this type from the input type.
Source§impl<'a> From<&'a StreamLockboxRef> for ValueRef<'a>
impl<'a> From<&'a StreamLockboxRef> for ValueRef<'a>
Source§fn from(v: &'a StreamLockboxRef) -> Self
fn from(v: &'a StreamLockboxRef) -> Self
Converts to this type from the input type.
Source§impl<'a, V: Into<ValueRef<'a>>> FromIterator<V> for ValueRef<'a>
impl<'a, V: Into<ValueRef<'a>>> FromIterator<V> for ValueRef<'a>
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<'a> Index<&str> for ValueRef<'a>
Support indexing into maps. If the index string is not in the map, this returns a
ValueRef::Null
.
impl<'a> Index<&str> for ValueRef<'a>
Support indexing into maps. If the index string is not in the map, this returns a
ValueRef::Null
.
Source§impl<'a> Index<usize> for ValueRef<'a>
Support indexing into arrays. If the index is out of range or the value isn’t an array, this
returns a ValueRef::Null
.
impl<'a> Index<usize> for ValueRef<'a>
Support indexing into arrays. If the index is out of range or the value isn’t an array, this
returns a ValueRef::Null
.
Source§impl<'a> TryFrom<ValueRef<'a>> for &'a DataLockboxRef
impl<'a> TryFrom<ValueRef<'a>> for &'a DataLockboxRef
Source§impl<'a> TryFrom<ValueRef<'a>> for &'a IdentityLockboxRef
impl<'a> TryFrom<ValueRef<'a>> for &'a IdentityLockboxRef
Source§impl<'a> TryFrom<ValueRef<'a>> for &'a LockLockboxRef
impl<'a> TryFrom<ValueRef<'a>> for &'a LockLockboxRef
Source§impl<'a> TryFrom<ValueRef<'a>> for &'a StreamLockboxRef
impl<'a> TryFrom<ValueRef<'a>> for &'a StreamLockboxRef
impl<'a> StructuralPartialEq for ValueRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for ValueRef<'a>
impl<'a> RefUnwindSafe for ValueRef<'a>
impl<'a> Send for ValueRef<'a>
impl<'a> Sync for ValueRef<'a>
impl<'a> Unpin for ValueRef<'a>
impl<'a> UnwindSafe for ValueRef<'a>
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