pub struct WasiHttp;Available on crate feature
p3 only.Expand description
The type for which this crate implements the wasi:http interfaces.
Trait Implementations§
Source§impl HasData for WasiHttp
impl HasData for WasiHttp
Source§type Data<'a> = WasiHttpCtxView<'a>
type Data<'a> = WasiHttpCtxView<'a>
The data associated with this trait implementation, chiefly used as a
generic associated type to allow plumbing the
'a lifetime into the
definition here. Read moreSource§impl HostRequestWithStore for WasiHttp
impl HostRequestWithStore for WasiHttp
Source§fn new<T>(
store: Access<'_, T, Self>,
headers: Resource<Headers>,
contents: Option<StreamReader<u8>>,
trailers: FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>,
options: Option<Resource<RequestOptions>>,
) -> Result<(Resource<Request>, FutureReader<Result<(), ErrorCode>>)>
fn new<T>( store: Access<'_, T, Self>, headers: Resource<Headers>, contents: Option<StreamReader<u8>>, trailers: FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>, options: Option<Resource<RequestOptions>>, ) -> Result<(Resource<Request>, FutureReader<Result<(), ErrorCode>>)>
Construct a new
request with a default method of GET, and
none values for path-with-query, scheme, and authority. Read moreSource§fn consume_body<T>(
store: Access<'_, T, Self>,
req: Resource<Request>,
fut: FutureReader<Result<(), ErrorCode>>,
) -> Result<(StreamReader<u8>, FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>)>
fn consume_body<T>( store: Access<'_, T, Self>, req: Resource<Request>, fut: FutureReader<Result<(), ErrorCode>>, ) -> Result<(StreamReader<u8>, FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>)>
Get body of the Request. Read more
fn drop<T>(store: Access<'_, T, Self>, req: Resource<Request>) -> Result<()>
Source§impl HostResponseWithStore for WasiHttp
impl HostResponseWithStore for WasiHttp
Source§fn new<T>(
store: Access<'_, T, Self>,
headers: Resource<Headers>,
contents: Option<StreamReader<u8>>,
trailers: FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>,
) -> Result<(Resource<Response>, FutureReader<Result<(), ErrorCode>>)>
fn new<T>( store: Access<'_, T, Self>, headers: Resource<Headers>, contents: Option<StreamReader<u8>>, trailers: FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>, ) -> Result<(Resource<Response>, FutureReader<Result<(), ErrorCode>>)>
Construct a new
response, with a default status-code of 200.
If a different status-code is needed, it must be set via the
set-status-code method. Read moreSource§fn consume_body<T>(
store: Access<'_, T, Self>,
res: Resource<Response>,
fut: FutureReader<Result<(), ErrorCode>>,
) -> Result<(StreamReader<u8>, FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>)>
fn consume_body<T>( store: Access<'_, T, Self>, res: Resource<Response>, fut: FutureReader<Result<(), ErrorCode>>, ) -> Result<(StreamReader<u8>, FutureReader<Result<Option<Resource<Trailers>>, ErrorCode>>)>
Get body of the Response. Read more
fn drop<T>(store: Access<'_, T, Self>, res: Resource<Response>) -> Result<()>
Source§impl HostWithStore for WasiHttp
impl HostWithStore for WasiHttp
Source§async fn handle<T>(
store: &Accessor<T, Self>,
req: Resource<Request>,
) -> Result<Resource<Response>, TrappableError<ErrorCode>>
async fn handle<T>( store: &Accessor<T, Self>, req: Resource<Request>, ) -> Result<Resource<Response>, TrappableError<ErrorCode>>
When exported, this function may be called with either an incoming
request read from the network or a request synthesized or forwarded by
another component. Read more
Auto Trait Implementations§
impl Freeze for WasiHttp
impl RefUnwindSafe for WasiHttp
impl Send for WasiHttp
impl Sync for WasiHttp
impl Unpin for WasiHttp
impl UnwindSafe for WasiHttp
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<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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