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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LockName
impl RefUnwindSafe for LockName
impl Send for LockName
impl Sync for LockName
impl Unpin for LockName
impl UnwindSafe for LockName
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