pub struct Key<'k> { /* private fields */ }
Expand description
A key in a key-value.
Implementations§
Source§impl<'k> Key<'k>
impl<'k> Key<'k>
Sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Get a borrowed string from this key.
The lifetime of the returned string is bound to the borrow of self
rather
than to 'k
.
Sourcepub fn to_borrowed_str(&self) -> Option<&'k str>
pub fn to_borrowed_str(&self) -> Option<&'k str>
Try get a borrowed string for the lifetime 'k
from this key.
If the key is a borrow of a longer lived string, this method will return Some
.
If the key is internally buffered, this method will return None
.
Trait Implementations§
Source§impl<'k> Ord for Key<'k>
impl<'k> Ord for Key<'k>
Source§impl<'k> PartialOrd for Key<'k>
impl<'k> PartialOrd for Key<'k>
impl<'k> Eq for Key<'k>
impl<'k> StructuralPartialEq for Key<'k>
Auto Trait Implementations§
impl<'k> Freeze for Key<'k>
impl<'k> RefUnwindSafe for Key<'k>
impl<'k> Send for Key<'k>
impl<'k> Sync for Key<'k>
impl<'k> Unpin for Key<'k>
impl<'k> UnwindSafe for Key<'k>
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