#[repr(packed(1))]pub struct SmallString {
pub len: u8,
pub str: [u8; 255],
}
Expand description
A string of length at most 255, with a more compact on-disk encoding.
Fields§
§len: u8
§str: [u8; 255]
Implementations§
Source§impl SmallString
impl SmallString
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn from_str(s: &str) -> Self
pub fn clone_from_str(&mut self, s: &str)
pub fn clear(&mut self)
pub fn push_str(&mut self, s: &str)
pub fn as_small_str(&self) -> SmallStr<'_>
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl Clone for SmallString
impl Clone for SmallString
Source§impl Debug for SmallString
impl Debug for SmallString
Source§impl Hash for SmallString
impl Hash for SmallString
Source§impl PartialEq for SmallString
impl PartialEq for SmallString
impl Eq for SmallString
Auto Trait Implementations§
impl Freeze for SmallString
impl RefUnwindSafe for SmallString
impl Send for SmallString
impl Sync for SmallString
impl Unpin for SmallString
impl UnwindSafe for SmallString
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