Enum OwnedValue
pub enum OwnedValue {
Num(u64),
Bytes(Vec<u8>),
}
Expand description
A value that stores its byte data as a Vec<u8>
.
Variants§
Trait Implementations§
§impl AsValue for OwnedValue
impl AsValue for OwnedValue
§fn unwrap_num(&self) -> u64
fn unwrap_num(&self) -> u64
If the value is an integer, returns the integer.
Otherwise, panics.
§fn unwrap_bytes(&self) -> &[u8] ⓘ
fn unwrap_bytes(&self) -> &[u8] ⓘ
If the value is Byte data, returns a reference to the bytestring.
Otherwise, panics.
§fn interpret_as_bool(&self) -> bool
fn interpret_as_bool(&self) -> bool
If the value is an integer, returns true if and only if the integer is non-zero.
Otherwise, panics.
§fn to_owned_value(&self) -> OwnedValue
fn to_owned_value(&self) -> OwnedValue
Converts the value to an
OwnedValue
.§impl Clone for OwnedValue
impl Clone for OwnedValue
§fn clone(&self) -> OwnedValue
fn clone(&self) -> OwnedValue
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for OwnedValue
impl Debug for OwnedValue
§impl<'de> Deserialize<'de> for OwnedValue
impl<'de> Deserialize<'de> for OwnedValue
§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
§impl Equivalent<OwnedValue> for Value<'_>
impl Equivalent<OwnedValue> for Value<'_>
§fn equivalent(&self, key: &OwnedValue) -> bool
fn equivalent(&self, key: &OwnedValue) -> bool
Checks if this value is equivalent to the given key. Read more
§impl Equivalent<Value<'_>> for OwnedValue
impl Equivalent<Value<'_>> for OwnedValue
§fn equivalent(&self, key: &Value<'_>) -> bool
fn equivalent(&self, key: &Value<'_>) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<'a> From<Value<'a>> for OwnedValue
impl<'a> From<Value<'a>> for OwnedValue
§impl FromIterator<OwnedValue> for InputValues
impl FromIterator<OwnedValue> for InputValues
§fn from_iter<T: IntoIterator<Item = OwnedValue>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = OwnedValue>>(iter: T) -> Self
Creates a value from an iterator. Read more
§impl Hash for OwnedValue
impl Hash for OwnedValue
The hash of an OwnedValue is the same as the hash of a Value<’_>
§impl Ord for OwnedValue
impl Ord for OwnedValue
§impl PartialEq<OwnedValue> for Value<'_>
impl PartialEq<OwnedValue> for Value<'_>
§impl PartialEq<OwnedValue> for u64
impl PartialEq<OwnedValue> for u64
§impl<'a> PartialEq<Value<'a>> for OwnedValue
impl<'a> PartialEq<Value<'a>> for OwnedValue
§impl PartialEq for OwnedValue
impl PartialEq for OwnedValue
§impl PartialOrd for OwnedValue
impl PartialOrd for OwnedValue
§impl Serialize for OwnedValue
impl Serialize for OwnedValue
impl Eq for OwnedValue
impl StructuralPartialEq for OwnedValue
Auto Trait Implementations§
impl Freeze for OwnedValue
impl RefUnwindSafe for OwnedValue
impl Send for OwnedValue
impl Sync for OwnedValue
impl Unpin for OwnedValue
impl UnwindSafe for OwnedValue
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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 more