pub enum DecisionParseError {
NotAnObject,
MissingAction,
UnknownAction(String),
MissingField {
action: &'static str,
field: &'static str,
},
Malformed(String),
}Expand description
Errors surfaced by HookDecision::parse. Hand-rolled
Display + Error per the v0.7 lesson (no thiserror in this
crate’s hot dependency tree).
Each variant is intentionally narrow so the executor’s warning
log can name the failure mode (unknown action "foo" vs
missing required field "reason").
Variants§
NotAnObject
The payload was not a JSON object (e.g. an array or scalar).
MissingAction
The payload was a JSON object but had no action key. This
is not the same as an empty {} — empty objects are
treated as Allow per the wire contract. NotAnObject
fires only when the bytes parse as JSON but action is
missing on a non-empty object.
UnknownAction(String)
The action discriminator named a string we don’t recognise.
MissingField
The decision shape is recognised but a required field is
missing (Deny without reason, Modify without delta,
AskUser without prompt or options).
Malformed(String)
Underlying JSON syntax / type error from serde_json.
Trait Implementations§
Source§impl Debug for DecisionParseError
impl Debug for DecisionParseError
Source§impl Display for DecisionParseError
impl Display for DecisionParseError
Source§impl Error for DecisionParseError
impl Error for DecisionParseError
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()
Auto Trait Implementations§
impl Freeze for DecisionParseError
impl RefUnwindSafe for DecisionParseError
impl Send for DecisionParseError
impl Sync for DecisionParseError
impl Unpin for DecisionParseError
impl UnsafeUnpin for DecisionParseError
impl UnwindSafe for DecisionParseError
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<T> ErasedDestructor for Twhere
T: 'static,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read moreSource§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.