Struct seaplane_cli::ops::metadata::KeyValue
source · 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