pub struct LoadOptions {
pub legacy_mode: bool,
pub strict_unknown_fields: bool,
pub allow_ineffective_assertions: bool,
}Expand description
What a caller wants the loader to refuse, rather than merely parse.
Each field is a separate axis on purpose. strict_unknown_fields and
allow_ineffective_assertions decide different things — a key the schema does not know versus
an assertion that no trace could ever fail — and folding them into one flag would mean a caller
who wanted one silently acquired the other.
Fields§
§legacy_mode: boolTreat a v0 config as v0 rather than trusting its declared version.
strict_unknown_fields: boolRefuse a config carrying keys this version does not understand.
allow_ineffective_assertions: boolAccept a config whose assertions: include one that cannot fail.
Refusing is the default, and this is the escape hatch. The phased route in #1949 was
warning, then opt-in, then default at a major: assay validate has warned since #1983, the
opt-in landed as --deny-ineffective-assertions, and 5.0.0 is the major that carries the
flip (#1949).
The polarity is inverted rather than the default being overridden, so that
#[derive(Default)] still produces the intended behaviour. A deny_* field defaulting to
true needs a hand-written Default, and every ..Default::default() in the tree would
then depend on that impl being right. false meaning “do not allow” is the same fact with
nothing to keep in sync.
Trait Implementations§
Source§impl Clone for LoadOptions
impl Clone for LoadOptions
Source§fn clone(&self) -> LoadOptions
fn clone(&self) -> LoadOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LoadOptions
Source§impl Debug for LoadOptions
impl Debug for LoadOptions
Source§impl Default for LoadOptions
impl Default for LoadOptions
Source§fn default() -> LoadOptions
fn default() -> LoadOptions
Auto Trait Implementations§
impl Freeze for LoadOptions
impl RefUnwindSafe for LoadOptions
impl Send for LoadOptions
impl Sync for LoadOptions
impl Unpin for LoadOptions
impl UnsafeUnpin for LoadOptions
impl UnwindSafe for LoadOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more