pub struct PolicyHttpHooks { /* private fields */ }Expand description
The capability gate for wasi:http, as one WasiHttpHooks covering both
wasip2 and wasip3 — wasmtime 48 routes them through the same hook.
Implementations§
Source§impl PolicyHttpHooks
impl PolicyHttpHooks
pub fn new( ceiling: Arc<dyn CompiledCeiling>, client: Arc<ActHttpClient>, prompter: Arc<dyn ConsentPrompter>, cache: Arc<DecisionCache>, ) -> Self
Trait Implementations§
Source§impl WasiHttpHooks for PolicyHttpHooks
impl WasiHttpHooks for PolicyHttpHooks
Source§fn send_request(
&mut self,
request: Request<WasiBody>,
options: Option<RequestOptions>,
fut: Box<dyn Future<Output = Result<(), HttpError>> + Send>,
) -> Box<dyn Future<Output = Result<(Response<WasiBody>, Box<dyn Future<Output = Result<(), HttpError>> + Send>), HttpError>> + Send>
fn send_request( &mut self, request: Request<WasiBody>, options: Option<RequestOptions>, fut: Box<dyn Future<Output = Result<(), HttpError>> + Send>, ) -> Box<dyn Future<Output = Result<(Response<WasiBody>, Box<dyn Future<Output = Result<(), HttpError>> + Send>), HttpError>> + Send>
Send an outgoing request. Read more
Source§fn is_forbidden_header(&mut self, name: &HeaderName) -> bool
fn is_forbidden_header(&mut self, name: &HeaderName) -> bool
Whether a given header should be considered forbidden and not allowed.
Source§fn is_supported_scheme(&mut self, scheme: &Scheme) -> bool
fn is_supported_scheme(&mut self, scheme: &Scheme) -> bool
Whether a given scheme should be considered supported. Read more
Source§fn set_host_header(&mut self) -> bool
fn set_host_header(&mut self) -> bool
Whether to set
host header in the request passed to send_request.Source§fn default_scheme(&mut self) -> Option<Scheme>
fn default_scheme(&mut self) -> Option<Scheme>
Scheme to default to, when not set by the guest. Read more
Source§fn p2_outgoing_body_buffer_chunks(&mut self) -> usize
fn p2_outgoing_body_buffer_chunks(&mut self) -> usize
Number of distinct write calls to the outgoing body’s output-stream
that the implementation will buffer.
Default: 1.
Source§fn p2_outgoing_body_chunk_size(&mut self) -> usize
fn p2_outgoing_body_chunk_size(&mut self) -> usize
Maximum size allowed in a write call to the outgoing body’s
output-stream. Default: 1024 * 1024.
Source§fn p2_error_from_hyper(&mut self, err: &Error) -> ErrorCode
fn p2_error_from_hyper(&mut self, err: &Error) -> ErrorCode
Optional hook to configure the error code for hyper errors.
Source§fn p2_error_from_connect(&mut self, err: &Error) -> ErrorCode
fn p2_error_from_connect(&mut self, err: &Error) -> ErrorCode
Optional hook to configure the error code for connect I/O errors.
Source§fn p2_error_from_tls(&mut self, err: &Error) -> ErrorCode
fn p2_error_from_tls(&mut self, err: &Error) -> ErrorCode
Optional hook to configure the error code for TLS I/O errors.
Source§fn p3_outgoing_body_chunk_size(&mut self) -> usize
fn p3_outgoing_body_chunk_size(&mut self) -> usize
Maximum number of bytes the implementation will copy out of the guest in
a single write to an outgoing body’s stream.
Source§fn p3_error_from_hyper(&mut self, err: &Error) -> ErrorCode
fn p3_error_from_hyper(&mut self, err: &Error) -> ErrorCode
Optional hook to configure the error code for hyper errors.
Source§fn p3_error_from_connect(&mut self, err: &Error) -> ErrorCode
fn p3_error_from_connect(&mut self, err: &Error) -> ErrorCode
Optional hook to configure the error code for connect I/O errors.
Source§fn p3_error_from_tls(&mut self, err: &Error) -> ErrorCode
fn p3_error_from_tls(&mut self, err: &Error) -> ErrorCode
Optional hook to configure the error code for TLS I/O errors.
Auto Trait Implementations§
impl !RefUnwindSafe for PolicyHttpHooks
impl !UnwindSafe for PolicyHttpHooks
impl Freeze for PolicyHttpHooks
impl Send for PolicyHttpHooks
impl Sync for PolicyHttpHooks
impl Unpin for PolicyHttpHooks
impl UnsafeUnpin for PolicyHttpHooks
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
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 moreSource§impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
impl<Source, Target> OctetsInto<Target> for Sourcewhere
Target: OctetsFrom<Source>,
type Error = <Target as OctetsFrom<Source>>::Error
Source§fn try_octets_into(
self,
) -> Result<Target, <Source as OctetsInto<Target>>::Error>
fn try_octets_into( self, ) -> Result<Target, <Source as OctetsInto<Target>>::Error>
Performs the conversion.