pub struct Key<T: AsRef<[u8]>>(/* private fields */);Implementations§
Source§impl Key<Vec<u8>>
impl Key<Vec<u8>>
pub fn new() -> Self
Sourcepub fn from_vec(key: Vec<u8>) -> Self
pub fn from_vec(key: Vec<u8>) -> Self
Create a KeyVec from a Vec<u8>. Will be removed in week 3.
Sourcepub fn set_from_slice(&mut self, key_slice: KeySlice<'_>)
pub fn set_from_slice(&mut self, key_slice: KeySlice<'_>)
Set the key from a slice without re-allocating. The signature will change in week 3.
pub fn as_key_slice(&self) -> KeySlice<'_>
pub fn into_key_bytes(self) -> KeyBytes
Sourcepub fn raw_ref(&self) -> &[u8] ⓘ
pub fn raw_ref(&self) -> &[u8] ⓘ
Always use raw_ref to access the key in week 1 + 2. This function will be removed in week 3.
pub fn for_testing_key_ref(&self) -> &[u8] ⓘ
pub fn for_testing_from_vec_no_ts(key: Vec<u8>) -> Self
Source§impl Key<Bytes>
impl Key<Bytes>
pub fn as_key_slice(&self) -> KeySlice<'_>
Sourcepub fn from_bytes(bytes: Bytes) -> KeyBytes
pub fn from_bytes(bytes: Bytes) -> KeyBytes
Create a KeyBytes from a Bytes. Will be removed in week 3.
Sourcepub fn raw_ref(&self) -> &[u8] ⓘ
pub fn raw_ref(&self) -> &[u8] ⓘ
Always use raw_ref to access the key in week 1 + 2. This function will be removed in week 3.
pub fn for_testing_from_bytes_no_ts(bytes: Bytes) -> KeyBytes
pub fn for_testing_key_ref(&self) -> &[u8] ⓘ
Source§impl<'a> Key<&'a [u8]>
impl<'a> Key<&'a [u8]>
pub fn to_key_vec(self) -> KeyVec
Sourcepub fn from_slice(slice: &'a [u8]) -> Self
pub fn from_slice(slice: &'a [u8]) -> Self
Create a key slice from a slice. Will be removed in week 3.
Sourcepub fn raw_ref(self) -> &'a [u8] ⓘ
pub fn raw_ref(self) -> &'a [u8] ⓘ
Always use raw_ref to access the key in week 1 + 2. This function will be removed in week 3.
pub fn for_testing_key_ref(self) -> &'a [u8] ⓘ
pub fn for_testing_from_slice_no_ts(slice: &'a [u8]) -> Self
pub fn for_testing_from_slice_with_ts(slice: &'a [u8], _ts: u64) -> Self
Trait Implementations§
Source§impl<T: AsRef<[u8]> + Ord> Ord for Key<T>
impl<T: AsRef<[u8]> + Ord> Ord for Key<T>
Source§impl<T: AsRef<[u8]> + PartialOrd> PartialOrd for Key<T>
impl<T: AsRef<[u8]> + PartialOrd> PartialOrd for Key<T>
impl<T: AsRef<[u8]> + Copy> Copy for Key<T>
impl<T: AsRef<[u8]> + Eq> Eq for Key<T>
Auto Trait Implementations§
impl<T> Freeze for Key<T>where
T: Freeze,
impl<T> RefUnwindSafe for Key<T>where
T: RefUnwindSafe,
impl<T> Send for Key<T>where
T: Send,
impl<T> Sync for Key<T>where
T: Sync,
impl<T> Unpin for Key<T>where
T: Unpin,
impl<T> UnwindSafe for Key<T>where
T: UnwindSafe,
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