pub struct ZeroString<'a> {
data: Cow<'a, str>,
}Expand description
A zero-copy string that can either borrow from the input or own its data
Fields§
§data: Cow<'a, str>Implementations§
Source§impl<'a> ZeroString<'a>
impl<'a> ZeroString<'a>
Sourcepub fn into_owned(self) -> String
pub fn into_owned(self) -> String
Convert to owned String
Sourcepub fn is_borrowed(&self) -> bool
pub fn is_borrowed(&self) -> bool
Check if this is borrowed data
Trait Implementations§
Source§impl<'a> AsRef<str> for ZeroString<'a>
impl<'a> AsRef<str> for ZeroString<'a>
Source§impl<'a> Clone for ZeroString<'a>
impl<'a> Clone for ZeroString<'a>
Source§fn clone(&self) -> ZeroString<'a>
fn clone(&self) -> ZeroString<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ZeroString<'a>
impl<'a> Debug for ZeroString<'a>
Source§impl<'a> From<&'a str> for ZeroString<'a>
impl<'a> From<&'a str> for ZeroString<'a>
Source§impl<'a> From<String> for ZeroString<'a>
impl<'a> From<String> for ZeroString<'a>
Source§impl<'a> PartialEq for ZeroString<'a>
impl<'a> PartialEq for ZeroString<'a>
impl<'a> Eq for ZeroString<'a>
impl<'a> StructuralPartialEq for ZeroString<'a>
Auto Trait Implementations§
impl<'a> Freeze for ZeroString<'a>
impl<'a> RefUnwindSafe for ZeroString<'a>
impl<'a> Send for ZeroString<'a>
impl<'a> Sync for ZeroString<'a>
impl<'a> Unpin for ZeroString<'a>
impl<'a> UnwindSafe for ZeroString<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.