pub struct Validated;Expand description
Marker type for a SecurityConfig whose invariants have been checked.
Reachable only through SecurityConfig::validate. Every entry point
that performs security-sensitive work — the
ArchiveFormat trait and
everything it calls — requires a SecurityConfig<Validated>, so an
unvalidated configuration (e.g. one with max_file_size == 0) can never
reach extraction, listing, or verification. The compiler enforces this;
it is not a convention callers must remember to follow.
Once validated, a config’s fields can still be read (via Deref) but
no longer written: DerefMut is implemented only for
SecurityConfig<Unvalidated>, so cfg.max_compression_ratio = f64::NAN
on a SecurityConfig<Validated> is a compile error, not a runtime
invariant violation. This is what makes the typestate airtight — without
it, a caller could validate a config and then mutate it back into an
invalid state before passing it to ArchiveFormat::extract.
Trait Implementations§
impl Copy for Validated
impl Eq for Validated
impl StructuralPartialEq for Validated
Auto Trait Implementations§
impl Freeze for Validated
impl RefUnwindSafe for Validated
impl Send for Validated
impl Sync for Validated
impl Unpin for Validated
impl UnsafeUnpin for Validated
impl UnwindSafe for Validated
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.