Trait sandkiste::types::MaybeString
source · pub trait MaybeString<'c>where
Self: From<String> + From<&'c str> + TryInto<String, Error = DatumConversionFailure<Self>>,{
// Required method
fn try_as_str(&self) -> Result<&str, TypeMismatch>;
// Provided method
fn try_into_string(self) -> Result<String, TypeMismatch> { ... }
}
Expand description
Types that can be an UTF-8 text string
Required Methods§
sourcefn try_as_str(&self) -> Result<&str, TypeMismatch>
fn try_as_str(&self) -> Result<&str, TypeMismatch>
Try to interpret datum as Unicode string
Provided Methods§
sourcefn try_into_string(self) -> Result<String, TypeMismatch>
fn try_into_string(self) -> Result<String, TypeMismatch>
Try to convert datum into Unicode string