[][src]Enum ledb::KeyData

pub enum KeyData {
    Int(i64),
    Float(OrderedFloat<f64>),
    String(String),
    Binary(Vec<u8>),
    Bool(bool),
}

The data of key

Variants

Int(i64)
String(String)
Binary(Vec<u8>)
Bool(bool)

Implementations

impl KeyData[src]

pub fn from_raw(typ: KeyType, raw: &[u8]) -> Result<Self>[src]

Converts binary representation into key data

pub fn as_raw(&self) -> &[u8][src]

Converts key data into binary representation

pub fn from_val(val: &Value) -> Option<Self>[src]

Converts generic value into key data

pub fn is_empty(&self) -> bool[src]

Value is empty

pub fn as_type(&self, typ: KeyType) -> Option<&KeyData>[src]

Simple data type casting

pub fn to_type(&self, typ: KeyType) -> Option<Cow<KeyData>>[src]

Convert key data into specified type

pub fn get_type(&self) -> KeyType[src]

Get the actual type of key data

Trait Implementations

impl Clone for KeyData[src]

impl Debug for KeyData[src]

impl<'de> Deserialize<'de> for KeyData[src]

impl Eq for KeyData[src]

impl<'a> From<&'a [u8]> for KeyData[src]

impl<'a> From<&'a String> for KeyData[src]

impl<'a> From<&'a Vec<u8>> for KeyData[src]

impl<'a> From<&'a bool> for KeyData[src]

impl<'a> From<&'a f64> for KeyData[src]

impl<'a> From<&'a i64> for KeyData[src]

impl<'a> From<&'a str> for KeyData[src]

impl From<String> for KeyData[src]

impl From<Vec<u8>> for KeyData[src]

impl From<bool> for KeyData[src]

impl From<f64> for KeyData[src]

impl From<i64> for KeyData[src]

impl Hash for KeyData[src]

impl Ord for KeyData[src]

impl PartialEq<KeyData> for KeyData[src]

impl PartialOrd<KeyData> for KeyData[src]

impl Serialize for KeyData[src]

impl StructuralEq for KeyData[src]

impl StructuralPartialEq for KeyData[src]

Auto Trait Implementations

impl RefUnwindSafe for KeyData

impl Send for KeyData

impl Sync for KeyData

impl Unpin for KeyData

impl UnwindSafe for KeyData

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.