pub struct BinaryKv<T>{
pub key: String,
pub value: T,
}Expand description
BinaryKV is how data is represented programmatically in the database.
It accepts any type that implements Serialize and Deserialize from the serde crate
and uses it for the value of the key-value pair.
use quick_kv::prelude::*;
BinaryKv::new("key".to_string(), "value".to_string());This is the same as:
use quick_kv::prelude::*;
let data = BinaryKv {
key: "key".to_string(),
value: "value".to_string(),
};Fields§
§key: StringThe key of the key-value pair
value: TThe value of the key-value pair
Implementations§
Trait Implementations§
source§impl<'de, T> Deserialize<'de> for BinaryKv<T>
impl<'de, T> Deserialize<'de> for BinaryKv<T>
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<T> PartialEq for BinaryKv<T>
impl<T> PartialEq for BinaryKv<T>
source§impl<T> PartialOrd for BinaryKv<T>
impl<T> PartialOrd for BinaryKv<T>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl<T> Eq for BinaryKv<T>
impl<T> StructuralEq for BinaryKv<T>
impl<T> StructuralPartialEq for BinaryKv<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for BinaryKv<T>where
T: RefUnwindSafe,
impl<T> Send for BinaryKv<T>where
T: Send,
impl<T> Sync for BinaryKv<T>where
T: Sync,
impl<T> Unpin for BinaryKv<T>where
T: Unpin,
impl<T> UnwindSafe for BinaryKv<T>where
T: UnwindSafe,
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