pub trait CheapMetaString {
// Required method
fn try_cheap_clone(&self) -> Option<MetaString>;
}Expand description
A string type that can be cheaply cloned into a MetaString.
While callers working directly with MetaString already have access to determine if it’s cheaply cloneable, there
are a number of use cases where MetaString isn’t directly accessible. This trait allows types wrapping
MetaString to expose the ability to cheaply clone the inner MetaString when possible, without having to expose
it directly.
Required Methods§
Sourcefn try_cheap_clone(&self) -> Option<MetaString>
fn try_cheap_clone(&self) -> Option<MetaString>
Attempts to cheaply clone the string.
If the string isn’t cheaply cloneable, None is returned.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".