pub struct KeyValue {
pub key: EncodedString,
pub value: EncodedString,
}Expand description
We use our own KeyValue instead of the models because we need to not enforce base64 encoding, and implement a bunch of additional methods and traits that wouldn’t make sense for the models
We also need to keep track if the values are encoded or not
Fields§
§key: EncodedString§value: EncodedStringImplementations§
Source§impl KeyValue
impl KeyValue
Sourcepub fn new<S: Into<String>>(key: S, value: S) -> Self
pub fn new<S: Into<String>>(key: S, value: S) -> Self
Creates a new KeyValue from an encoded key and value. You must pinky promise the key and value are URL safe base64 encoded or Bad Things may happen.
Sourcepub fn new_unencoded<S: AsRef<str>>(key: S, value: S) -> Self
pub fn new_unencoded<S: AsRef<str>>(key: S, value: S) -> Self
Creates a new KeyValue from an un-encoded key and value, encoding them along the way
Sourcepub fn from_key_unencoded<S: AsRef<str>>(key: S) -> Self
pub fn from_key_unencoded<S: AsRef<str>>(key: S) -> Self
Creates a new KeyValue from an un-encoded string ref, encoding it along the way
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyValue
impl RefUnwindSafe for KeyValue
impl Send for KeyValue
impl Sync for KeyValue
impl Unpin for KeyValue
impl UnwindSafe for KeyValue
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