pub struct ActHttpClient { /* private fields */ }Expand description
An HTTP client carrying this component’s capability ceiling.
Two enforcement points, and both are inside the client rather than around it: the resolver refuses addresses a CIDR rule excludes, and the redirect predicate refuses a hop outside the ceiling. A check placed around a client is a check a redirect walks past.
Cheap to clone; share freely across tasks.
Implementations§
Source§impl ActHttpClient
impl ActHttpClient
pub fn new(cfg: HttpConfig) -> Result<Self>
Sourcepub async fn send(
&self,
request: Request<WasiBody>,
options: Option<RequestOptions>,
) -> Result<(Response<WasiBody>, Pin<Box<dyn Future<Output = Result<(), HttpError>> + Send>>), HttpError>
pub async fn send( &self, request: Request<WasiBody>, options: Option<RequestOptions>, ) -> Result<(Response<WasiBody>, Pin<Box<dyn Future<Output = Result<(), HttpError>> + Send>>), HttpError>
Perform an outgoing request.
One method since wasmtime 48, which routes p2 and p3 through the same
hook. options carries the guest’s wasi:http/types.request-options;
each field falls back to 600 s, matching what wasmtime itself supplies
when the guest sets none, so the p2 path keeps the deadline it always
had and the p3 path gains the one it should have had.
Trait Implementations§
Source§impl Clone for ActHttpClient
impl Clone for ActHttpClient
Source§fn clone(&self) -> ActHttpClient
fn clone(&self) -> ActHttpClient
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 !RefUnwindSafe for ActHttpClient
impl !UnwindSafe for ActHttpClient
impl Freeze for ActHttpClient
impl Send for ActHttpClient
impl Sync for ActHttpClient
impl Unpin for ActHttpClient
impl UnsafeUnpin for ActHttpClient
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.