pub trait FromSetting<'a>: Sized {
const EXPECTED: &'static str;
// Required method
fn from_setting(value: &'a Document) -> Option<Self>;
}Expand description
Converts a settings value into a type, optionally borrowing from the document.
Protocols can implement this trait for their own settings types. Return None
when the value is invalid; get reports it as a configuration error.
Required Associated Constants§
Required Methods§
Sourcefn from_setting(value: &'a Document) -> Option<Self>
fn from_setting(value: &'a Document) -> Option<Self>
Converts a value, returning None if it does not match this type.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.