#[non_exhaustive]pub enum FactLoadResult<V> {
Found(V),
Missing,
Error(FactLoadError),
}Expand description
Result of loading one fact.
This is shaped like Result<Option<V>, FactLoadError> — Found, Missing,
and Error map onto Ok(Some), Ok(None), and Err. A dedicated enum is
used instead so the three outcomes read as domain concepts at policy call
sites (FactLoadResult::Missing rather than Ok(None)), so “the fact does
not exist” is never visually conflated with “the load failed” — a
distinction that matters for fail-closed authorization — and so the type can
gain variants later without breaking a Result alias callers rely on.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Found(V)
The fact exists and has the given value.
Missing
The fact source was reached, but no value exists for the key.
Error(FactLoadError)
Loading failed. Policies should map this to a denied decision.
Trait Implementations§
Source§impl<V: Clone> Clone for FactLoadResult<V>
impl<V: Clone> Clone for FactLoadResult<V>
Source§fn clone(&self) -> FactLoadResult<V>
fn clone(&self) -> FactLoadResult<V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<V> !RefUnwindSafe for FactLoadResult<V>
impl<V> !UnwindSafe for FactLoadResult<V>
impl<V> Freeze for FactLoadResult<V>where
V: Freeze,
impl<V> Send for FactLoadResult<V>where
V: Send,
impl<V> Sync for FactLoadResult<V>where
V: Sync,
impl<V> Unpin for FactLoadResult<V>where
V: Unpin,
impl<V> UnsafeUnpin for FactLoadResult<V>where
V: UnsafeUnpin,
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
Mutably borrows from an owned value. Read more