pub trait Value: AsRef<str> + Default + PartialEq + Sized {
// Required methods
fn from_cow_str(value: Cow<'_, str>) -> Self;
fn from_format_args(format_args: Arguments<'_>) -> Self;
// Provided methods
fn from_str(value: &str) -> Self { ... }
fn from_string(value: String) -> Self { ... }
}
Expand description
Common trait for values
Required Methods§
sourcefn from_cow_str(value: Cow<'_, str>) -> Self
fn from_cow_str(value: Cow<'_, str>) -> Self
Create a value from a copy-on-write string.
The argument must be a valid value.
sourcefn from_format_args(format_args: Arguments<'_>) -> Self
fn from_format_args(format_args: Arguments<'_>) -> Self
Create a value from a precompiled format string.
Provided Methods§
sourcefn from_str(value: &str) -> Self
fn from_str(value: &str) -> Self
Create a value from a borrowed string slice.
The argument must be a valid value.
sourcefn from_string(value: String) -> Self
fn from_string(value: String) -> Self
Create a value from a owned string.
The argument must be a valid value.
Object Safety§
This trait is not object safe.