WasiHttpCtxView

Struct WasiHttpCtxView 

Source
pub struct WasiHttpCtxView<'a> {
    pub ctx: &'a mut dyn WasiHttpCtx,
    pub table: &'a mut ResourceTable,
}
Available on crate feature p3 only.
Expand description

View into WasiHttpCtx implementation and ResourceTable.

Fields§

§ctx: &'a mut dyn WasiHttpCtx

Mutable reference to the WASI HTTP context.

§table: &'a mut ResourceTable

Mutable reference to table used to manage resources.

Trait Implementations§

Source§

impl Host for WasiHttpCtxView<'_>

Source§

impl HostFields for WasiHttpCtxView<'_>

Source§

fn new(&mut self) -> Result<Resource<Fields>>

Construct an empty HTTP Fields. Read more
Source§

fn from_list( &mut self, entries: Vec<(FieldName, FieldValue)>, ) -> Result<Resource<Fields>, TrappableError<HeaderError>>

Construct an HTTP Fields. Read more
Source§

fn get( &mut self, fields: Resource<Fields>, name: FieldName, ) -> Result<Vec<FieldValue>>

Get all of the values corresponding to a name. If the name is not present in this fields, an empty list is returned. However, if the name is present but empty, this is represented by a list with one or more empty field-values present.
Source§

fn has(&mut self, fields: Resource<Fields>, name: FieldName) -> Result<bool>

Returns true when the name is present in this fields. If the name is syntactically invalid, false is returned.
Source§

fn set( &mut self, fields: Resource<Fields>, name: FieldName, value: Vec<FieldValue>, ) -> Result<(), TrappableError<HeaderError>>

Set all of the values for a name. Clears any existing values for that name, if they have been set. Read more
Source§

fn delete( &mut self, fields: Resource<Fields>, name: FieldName, ) -> Result<(), TrappableError<HeaderError>>

Delete all values for a name. Does nothing if no values for the name exist. Read more
Source§

fn get_and_delete( &mut self, fields: Resource<Fields>, name: FieldName, ) -> Result<Vec<FieldValue>, TrappableError<HeaderError>>

Delete all values for a name. Does nothing if no values for the name exist. Read more
Source§

fn append( &mut self, fields: Resource<Fields>, name: FieldName, value: FieldValue, ) -> Result<(), TrappableError<HeaderError>>

Append a value for a name. Does not change or delete any existing values for that name. Read more
Source§

fn copy_all( &mut self, fields: Resource<Fields>, ) -> Result<Vec<(FieldName, FieldValue)>>

Retrieve the full set of names and values in the Fields. Like the constructor, the list represents each name-value pair. Read more
Source§

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

Make a deep copy of the Fields. Equivalent in behavior to calling the fields constructor on the return value of copy-all. The resulting fields is mutable.
Source§

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

Source§

impl HostRequest for WasiHttpCtxView<'_>

Source§

fn get_method(&mut self, req: Resource<Request>) -> Result<Method>

Get the Method for the Request.
Source§

fn set_method( &mut self, req: Resource<Request>, method: Method, ) -> Result<Result<(), ()>>

Set the Method for the Request. Fails if the string present in a method.other argument is not a syntactically valid method.
Source§

fn get_path_with_query( &mut self, req: Resource<Request>, ) -> Result<Option<String>>

Get the combination of the HTTP Path and Query for the Request. When none, this represents an empty Path and empty Query.
Source§

fn set_path_with_query( &mut self, req: Resource<Request>, path_with_query: Option<String>, ) -> Result<Result<(), ()>>

Set the combination of the HTTP Path and Query for the Request. When none, this represents an empty Path and empty Query. Fails is the string given is not a syntactically valid path and query uri component.
Source§

fn get_scheme(&mut self, req: Resource<Request>) -> Result<Option<Scheme>>

Get the HTTP Related Scheme for the Request. When none, the implementation may choose an appropriate default scheme.
Source§

fn set_scheme( &mut self, req: Resource<Request>, scheme: Option<Scheme>, ) -> Result<Result<(), ()>>

Set the HTTP Related Scheme for the Request. When none, the implementation may choose an appropriate default scheme. Fails if the string given is not a syntactically valid uri scheme.
Source§

fn get_authority(&mut self, req: Resource<Request>) -> Result<Option<String>>

Get the authority of the Request’s target URI. A value of none may be used with Related Schemes which do not require an authority. The HTTP and HTTPS schemes always require an authority.
Source§

fn set_authority( &mut self, req: Resource<Request>, authority: Option<String>, ) -> Result<Result<(), ()>>

Set the authority of the Request’s target URI. A value of none may be used with Related Schemes which do not require an authority. The HTTP and HTTPS schemes always require an authority. Fails if the string given is not a syntactically valid URI authority.
Source§

fn get_options( &mut self, req: Resource<Request>, ) -> Result<Option<Resource<RequestOptions>>>

Get the request-options to be associated with this request Read more
Source§

fn get_headers(&mut self, req: Resource<Request>) -> Result<Resource<Headers>>

Get the headers associated with the Request. Read more
Source§

impl HostRequestOptions for WasiHttpCtxView<'_>

Source§

fn new(&mut self) -> Result<Resource<RequestOptions>>

Construct a default request-options value.
Source§

fn get_connect_timeout( &mut self, opts: Resource<RequestOptions>, ) -> Result<Option<Duration>>

The timeout for the initial connect to the HTTP Server.
Source§

fn set_connect_timeout( &mut self, opts: Resource<RequestOptions>, duration: Option<Duration>, ) -> Result<(), TrappableError<RequestOptionsError>>

Set the timeout for the initial connect to the HTTP Server. An error return value indicates that this timeout is not supported or that this handle is immutable.
Source§

fn get_first_byte_timeout( &mut self, opts: Resource<RequestOptions>, ) -> Result<Option<Duration>>

The timeout for receiving the first byte of the Response body.
Source§

fn set_first_byte_timeout( &mut self, opts: Resource<RequestOptions>, duration: Option<Duration>, ) -> Result<(), TrappableError<RequestOptionsError>>

Set the timeout for receiving the first byte of the Response body. An error return value indicates that this timeout is not supported or that this handle is immutable.
Source§

fn get_between_bytes_timeout( &mut self, opts: Resource<RequestOptions>, ) -> Result<Option<Duration>>

The timeout for receiving subsequent chunks of bytes in the Response body stream.
Source§

fn set_between_bytes_timeout( &mut self, opts: Resource<RequestOptions>, duration: Option<Duration>, ) -> Result<(), TrappableError<RequestOptionsError>>

Set the timeout for receiving subsequent chunks of bytes in the Response body stream. An error return value indicates that this timeout is not supported or that this handle is immutable.
Source§

fn clone( &mut self, opts: Resource<RequestOptions>, ) -> Result<Resource<RequestOptions>>

Make a deep copy of the request-options. The resulting request-options is mutable.
Source§

fn drop(&mut self, opts: Resource<RequestOptions>) -> Result<()>

Source§

impl HostResponse for WasiHttpCtxView<'_>

Source§

fn get_status_code(&mut self, res: Resource<Response>) -> Result<StatusCode>

Get the HTTP Status Code for the Response.
Source§

fn set_status_code( &mut self, res: Resource<Response>, status_code: StatusCode, ) -> Result<Result<(), ()>>

Set the HTTP Status Code for the Response. Fails if the status-code given is not a valid http status code.
Source§

fn get_headers(&mut self, res: Resource<Response>) -> Result<Resource<Headers>>

Get the headers associated with the Response. Read more
Source§

impl Host for WasiHttpCtxView<'_>

Auto Trait Implementations§

§

impl<'a> Freeze for WasiHttpCtxView<'a>

§

impl<'a> !RefUnwindSafe for WasiHttpCtxView<'a>

§

impl<'a> Send for WasiHttpCtxView<'a>

§

impl<'a> !Sync for WasiHttpCtxView<'a>

§

impl<'a> Unpin for WasiHttpCtxView<'a>

§

impl<'a> !UnwindSafe for WasiHttpCtxView<'a>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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.

§

impl<T> GetSetFdFlags for T

§

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,

Create a new SetFdFlags value for use with set_fd_flags. Read more
§

fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>
where T: AsFilelike,

Set the “status” flags for the self file descriptor. Read more
§

impl<T> Instrument for T

§

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

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

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 T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Pointer = u32

§

fn debug( pointer: <T as Pointee>::Pointer, f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T