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 is cheaply cloneable, there
are a number of use cases where MetaString
is not 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 is not cheaply cloneable, None
is returned.