Struct seaplane_cli::ops::locks::LockName
source · pub struct LockName {
pub name: EncodedString,
}Expand description
We use our own LockName 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§
§name: EncodedStringImplementations§
source§impl LockName
impl LockName
sourcepub fn new<S: Into<String>>(name: S) -> Self
pub fn new<S: Into<String>>(name: S) -> Self
Creates a new LockName from an encoded name. You must pinky promise the name is URL safe base64 encoded or Bad Things may happen.
sourcepub fn from_name_unencoded<S: AsRef<[u8]>>(name: S) -> Self
pub fn from_name_unencoded<S: AsRef<[u8]>>(name: S) -> Self
Creates a new LockName from an un-encoded byte slice ref, encoding it along the way
sourcepub fn to_model(&self) -> LockNameModel
pub fn to_model(&self) -> LockNameModel
Creates a new LockName from self’s data.