pub enum DomString {
Static(&'static str),
Heap(String),
}
Expand description
Most strings are known at compile time, spares a bit of
heap allocations - for &'static str
, simply stores the pointer,
instead of converting it into a String. This is good for class names
or IDs, whose content rarely changes.
Variants§
Implementations§
Trait Implementations§
Source§impl Ord for DomString
impl Ord for DomString
Source§impl PartialOrd for DomString
impl PartialOrd for DomString
impl Eq for DomString
Auto Trait Implementations§
impl Freeze for DomString
impl RefUnwindSafe for DomString
impl Send for DomString
impl Sync for DomString
impl Unpin for DomString
impl UnwindSafe for DomString
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
)