pub enum HttpPolicyError {
NotAllowed,
NoEgress,
Transport(FnError),
Status(u16),
}Expand description
Why a capability-gated HTTP call was refused.
The loaders share the decisions and keep their own encoding: the Extism
loader maps these onto the numeric FnError codes its guest ABI pins
(0xC20, 0xC21, 0xC23), the Rhai loader onto EvalAltResult strings.
Splitting it this way is what lets both share the policy without either
changing its published error contract.
Variants§
NotAllowed
The URL is outside the granted Capability::Network allow-list.
NoEgress
No HttpEgress implementation was wired in.
Transport(FnError)
The transport itself failed.
Status(u16)
The response carried a >= 400 status.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HttpPolicyError
impl RefUnwindSafe for HttpPolicyError
impl Send for HttpPolicyError
impl Sync for HttpPolicyError
impl Unpin for HttpPolicyError
impl UnsafeUnpin for HttpPolicyError
impl UnwindSafe for HttpPolicyError
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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