pub trait DeserializeOrDefault<T>: Sized {
// Required method
fn deserialize_or_default(
dcx: &DiagCtxt<'_>,
value: &Spanned<DeValue<'_>>,
default: T,
) -> Self;
}Expand description
A type which can be deserialized from a toml value with a fallback to a default value.
Required Methods§
Sourcefn deserialize_or_default(
dcx: &DiagCtxt<'_>,
value: &Spanned<DeValue<'_>>,
default: T,
) -> Self
fn deserialize_or_default( dcx: &DiagCtxt<'_>, value: &Spanned<DeValue<'_>>, default: T, ) -> Self
Attempt to deserialize the value. Returns the default value and raises an error on failure.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".