pub trait StringExt: Sized {
// Required methods
fn optional(&self) -> Option<&Self>;
fn into_optional(self) -> Option<Self>;
}Required Methods§
Sourcefn into_optional(self) -> Option<Self>
fn into_optional(self) -> Option<Self>
Returns Some if the string has content, otherwise None.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".