pub(crate) enum Repr {
Inline {
len: InlineSize,
buf: [u8; 23],
},
Static(&'static str),
Heap(Arc<str>),
}
Variants§
Implementations§
source§impl Repr
impl Repr
sourcepub(crate) fn new_on_stack<T>(text: T) -> Option<Self>
pub(crate) fn new_on_stack<T>(text: T) -> Option<Self>
This function tries to create a new Repr::Inline or Repr::Static If it isn’t possible, this function returns None
pub(crate) fn new<T>(text: T) -> Self
pub(crate) fn len(&self) -> usize
pub(crate) fn is_empty(&self) -> bool
pub(crate) fn as_str(&self) -> &str
pub(crate) fn ptr_eq(&self, other: &Self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repr
impl RefUnwindSafe for Repr
impl Send for Repr
impl Sync for Repr
impl Unpin for Repr
impl UnwindSafe for Repr
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)