pub struct KeyId(/* private fields */);Expand description
COSE kid (bstr, 1..=128 bytes). Basil catalog names are UTF-8; other
consumers may use raw byte ids.
Implementations§
Source§impl KeyId
impl KeyId
Sourcepub fn from_text(id: &str) -> Result<Self, ProfileError>
pub fn from_text(id: &str) -> Result<Self, ProfileError>
Build a key id from the UTF-8 bytes of a catalog name.
§Errors
ProfileError::KeyIdLength if the name is empty or longer than 128
bytes.
Sourcepub fn from_bytes(id: Vec<u8>) -> Result<Self, ProfileError>
pub fn from_bytes(id: Vec<u8>) -> Result<Self, ProfileError>
Sourcepub fn as_catalog_name(&self) -> Option<&str>
pub fn as_catalog_name(&self) -> Option<&str>
The catalog name, when the id is valid UTF-8.
Trait Implementations§
impl Eq for KeyId
Source§impl Ord for KeyId
impl Ord for KeyId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for KeyId
impl PartialOrd for KeyId
impl StructuralPartialEq for KeyId
Auto Trait Implementations§
impl Freeze for KeyId
impl RefUnwindSafe for KeyId
impl Send for KeyId
impl Sync for KeyId
impl Unpin for KeyId
impl UnsafeUnpin for KeyId
impl UnwindSafe for KeyId
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