pub struct WasiHttp {
    pub request_id_base: u32,
    pub response_id_base: u32,
    pub fields_id_base: u32,
    pub streams_id_base: u32,
    pub requests: HashMap<u32, ActiveRequest>,
    pub responses: HashMap<u32, ActiveResponse>,
    pub fields: HashMap<u32, HashMap<String, Vec<String>>>,
    pub streams: HashMap<u32, Stream>,
}

Fields§

§request_id_base: u32§response_id_base: u32§fields_id_base: u32§streams_id_base: u32§requests: HashMap<u32, ActiveRequest>§responses: HashMap<u32, ActiveResponse>§fields: HashMap<u32, HashMap<String, Vec<String>>>§streams: HashMap<u32, Stream>

Implementations§

source§

impl WasiHttp

source

pub fn new() -> Self

Trait Implementations§

source§

impl Clone for WasiHttp

source§

fn clone(&self) -> WasiHttp

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Host for WasiHttp

source§

impl Host for WasiHttp

source§

fn drop_fields(&mut self, fields: Fields) -> Result<()>

source§

fn new_fields(&mut self, entries: Vec<(String, String)>) -> Result<Fields>

source§

fn fields_get(&mut self, fields: Fields, name: String) -> Result<Vec<String>>

source§

fn fields_set( &mut self, fields: Fields, name: String, value: Vec<String> ) -> Result<()>

source§

fn fields_delete(&mut self, fields: Fields, name: String) -> Result<()>

source§

fn fields_append( &mut self, fields: Fields, name: String, value: String ) -> Result<()>

source§

fn fields_entries(&mut self, fields: Fields) -> Result<Vec<(String, String)>>

source§

fn fields_clone(&mut self, fields: Fields) -> Result<Fields>

source§

fn finish_incoming_stream( &mut self, s: IncomingStream ) -> Result<Option<Trailers>>

source§

fn finish_outgoing_stream( &mut self, _s: OutgoingStream, _trailers: Option<Trailers> ) -> Result<()>

source§

fn drop_incoming_request(&mut self, _request: IncomingRequest) -> Result<()>

source§

fn drop_outgoing_request(&mut self, request: OutgoingRequest) -> Result<()>

source§

fn incoming_request_method( &mut self, _request: IncomingRequest ) -> Result<Method>

source§

fn incoming_request_path(&mut self, _request: IncomingRequest) -> Result<String>

source§

fn incoming_request_scheme( &mut self, _request: IncomingRequest ) -> Result<Option<Scheme>>

source§

fn incoming_request_authority( &mut self, _request: IncomingRequest ) -> Result<String>

source§

fn incoming_request_headers( &mut self, _request: IncomingRequest ) -> Result<Headers>

source§

fn incoming_request_consume( &mut self, _request: IncomingRequest ) -> Result<Result<IncomingStream, ()>>

source§

fn incoming_request_query( &mut self, _request: IncomingRequest ) -> Result<String>

source§

fn new_outgoing_request( &mut self, method: Method, path: String, query: String, scheme: Option<Scheme>, authority: String, headers: Headers ) -> Result<OutgoingRequest>

source§

fn outgoing_request_write( &mut self, request: OutgoingRequest ) -> Result<Result<OutgoingStream, ()>>

source§

fn drop_response_outparam(&mut self, _response: ResponseOutparam) -> Result<()>

source§

fn set_response_outparam( &mut self, _outparam: ResponseOutparam, _response: Result<OutgoingResponse, Error> ) -> Result<Result<(), ()>>

source§

fn drop_incoming_response(&mut self, response: IncomingResponse) -> Result<()>

source§

fn drop_outgoing_response(&mut self, _response: OutgoingResponse) -> Result<()>

source§

fn incoming_response_status( &mut self, response: IncomingResponse ) -> Result<StatusCode>

source§

fn incoming_response_headers( &mut self, response: IncomingResponse ) -> Result<Headers>

source§

fn incoming_response_consume( &mut self, response: IncomingResponse ) -> Result<Result<IncomingStream, ()>>

source§

fn new_outgoing_response( &mut self, _status_code: StatusCode, _headers: Headers ) -> Result<OutgoingResponse>

source§

fn outgoing_response_write( &mut self, _response: OutgoingResponse ) -> Result<Result<OutgoingStream, ()>>

source§

fn drop_future_incoming_response( &mut self, _f: FutureIncomingResponse ) -> Result<()>

source§

fn future_incoming_response_get( &mut self, _f: FutureIncomingResponse ) -> Result<Option<Result<IncomingResponse, Error>>>

source§

fn listen_to_future_incoming_response( &mut self, _f: FutureIncomingResponse ) -> Result<Pollable>

source§

impl Host for WasiHttp

source§

fn read( &mut self, stream: InputStream, len: u64 ) -> Result<Result<(Vec<u8>, bool), StreamError>>

Read bytes from a stream. Read more
source§

fn skip( &mut self, stream: InputStream, len: u64 ) -> Result<Result<(u64, bool), StreamError>>

Skip bytes from a stream. Read more
source§

fn subscribe_to_input_stream(&mut self, _this: InputStream) -> Result<Pollable>

Create a pollable which will resolve once either the specified stream has bytes available to read or the other end of the stream has been closed.
source§

fn drop_input_stream(&mut self, stream: InputStream) -> Result<()>

Dispose of the specified input-stream, after which it may no longer be used.
source§

fn write( &mut self, this: OutputStream, buf: Vec<u8> ) -> Result<Result<u64, StreamError>>

Write bytes to a stream. Read more
source§

fn write_zeroes( &mut self, this: OutputStream, len: u64 ) -> Result<Result<u64, StreamError>>

Write multiple zero bytes to a stream. Read more
source§

fn splice( &mut self, _this: OutputStream, _src: InputStream, _len: u64 ) -> Result<Result<(u64, bool), StreamError>>

Read from one stream and write to another. Read more
source§

fn forward( &mut self, _this: OutputStream, _src: InputStream ) -> Result<Result<u64, StreamError>>

Forward the entire contents of an input stream to an output stream. Read more
source§

fn subscribe_to_output_stream( &mut self, _this: OutputStream ) -> Result<Pollable>

Create a pollable which will resolve once either the specified stream is ready to accept bytes or the other end of the stream has been closed.
source§

fn drop_output_stream(&mut self, stream: OutputStream) -> Result<()>

Dispose of the specified output-stream, after which it may no longer be used.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more