pub enum StaticOrHeapString {
Static(&'static str),
Heap(String),
}
Expand description
A string type that can either be a static string slice or an owned heap-allocated string.
Variants§
Implementations§
Source§impl StaticOrHeapString
impl StaticOrHeapString
Sourcepub fn as_mut_str(&mut self) -> &mut str
pub fn as_mut_str(&mut self) -> &mut str
Returns the mutable string slice representation of the enum variant.
Trait Implementations§
Source§impl Clone for StaticOrHeapString
impl Clone for StaticOrHeapString
Source§fn clone(&self) -> StaticOrHeapString
fn clone(&self) -> StaticOrHeapString
Returns a copy 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 Debug for StaticOrHeapString
impl Debug for StaticOrHeapString
Source§impl<'de> Deserialize<'de> for StaticOrHeapString
impl<'de> Deserialize<'de> for StaticOrHeapString
Source§fn deserialize<D>(deserializer: D) -> Result<StaticOrHeapString, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<StaticOrHeapString, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&'static str> for StaticOrHeapString
impl From<&'static str> for StaticOrHeapString
Source§impl From<String> for StaticOrHeapString
impl From<String> for StaticOrHeapString
Source§impl Hash for StaticOrHeapString
impl Hash for StaticOrHeapString
Source§impl Ord for StaticOrHeapString
impl Ord for StaticOrHeapString
Source§impl PartialEq for StaticOrHeapString
impl PartialEq for StaticOrHeapString
Source§impl PartialOrd for StaticOrHeapString
impl PartialOrd for StaticOrHeapString
Source§impl Serialize for StaticOrHeapString
impl Serialize for StaticOrHeapString
impl Eq for StaticOrHeapString
Auto Trait Implementations§
impl Freeze for StaticOrHeapString
impl RefUnwindSafe for StaticOrHeapString
impl Send for StaticOrHeapString
impl Sync for StaticOrHeapString
impl Unpin for StaticOrHeapString
impl UnwindSafe for StaticOrHeapString
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