#[non_exhaustive]pub enum PolicyError {
InvalidPath {
path: String,
message: String,
},
InvalidUrl {
message: String,
},
InvalidInput {
message: String,
},
Transport {
host: String,
message: String,
},
Status {
status: StatusCode,
body: String,
},
InvalidResponse {
message: String,
},
Engine {
message: String,
},
}Expand description
Why a policy could not be evaluated.
Approval policies built with policy_approval
turn these into a denial (or fall through, see
FailureMode); the error is exposed for callers
that evaluate a PolicyClient directly.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidPath
The policy path is empty or contains an empty or blank segment.
InvalidUrl
The policy server URL was rejected by the URL policy or cannot carry the data path.
InvalidInput
The policy input could not be encoded.
Transport
The request to the policy server failed below the HTTP status layer (connection, TLS, timeout, body limits).
Status
The policy server answered with a non-success status.
Fields
status: StatusCodeThe status code.
InvalidResponse
The response body is not the expected JSON document.
Engine
The embedded policy engine rejected the policy, the data document or the rule path, or failed during evaluation.
Trait Implementations§
Source§impl Clone for PolicyError
impl Clone for PolicyError
Source§fn clone(&self) -> PolicyError
fn clone(&self) -> PolicyError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PolicyError
impl Debug for PolicyError
Source§impl Display for PolicyError
impl Display for PolicyError
impl Eq for PolicyError
Source§impl Error for PolicyError
impl Error for PolicyError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl PartialEq for PolicyError
impl PartialEq for PolicyError
impl StructuralPartialEq for PolicyError
Auto Trait Implementations§
impl Freeze for PolicyError
impl RefUnwindSafe for PolicyError
impl Send for PolicyError
impl Sync for PolicyError
impl Unpin for PolicyError
impl UnsafeUnpin for PolicyError
impl UnwindSafe for PolicyError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.