Struct libpijul::small_string::SmallString [−][src]
Expand description
A string of length at most 255, with a more compact on-disk encoding.
Fields
len: u8
str: [u8; 255]
Implementations
ⓘ
use libpijul::small_string::*; let mut s = SmallString::from_str("blah!"); assert_eq!(s.len(), s.as_str().len());
ⓘ
use libpijul::small_string::*; let mut s = SmallString::from_str("blah"); s.clear(); assert_eq!(s.as_str(), ""); assert!(s.is_empty());
ⓘ
use libpijul::small_string::*; let mut s = SmallString::from_str("blah"); s.clear(); assert!(s.is_empty());
Methods from Deref<Target = SmallStr>
ⓘ
use libpijul::small_string::*; let mut s = SmallString::from_str(""); assert!(s.as_small_str().is_empty()); s.push_str("blah"); assert!(!s.as_small_str().is_empty());
ⓘ
use libpijul::small_string::*; let mut s = SmallString::from_str("blah"); assert_eq!(s.as_small_str().len(), "blah".len())
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for SmallString
impl Send for SmallString
impl Sync for SmallString
impl Unpin for SmallString
impl UnwindSafe for SmallString
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self