pub struct Ctx {Show 13 fields
pub table: ResourceTable,
pub http: WasiHttpCtx,
pub init_at: u64,
pub environment: Vec<(String, String)>,
pub arguments: Vec<String>,
pub initial_cwd: Option<String>,
pub stdin: InputStream,
pub stdout: OutputStream,
pub stderr: OutputStream,
pub filesystem: WasiFilesystemCtx,
pub random: WasiRandomCtx,
pub shutdown: Receiver<u64>,
pub deadline: u64,
}
Fields§
§table: ResourceTable
§http: WasiHttpCtx
§init_at: u64
§environment: Vec<(String, String)>
§arguments: Vec<String>
§initial_cwd: Option<String>
§stdin: InputStream
§stdout: OutputStream
§stderr: OutputStream
§filesystem: WasiFilesystemCtx
§random: WasiRandomCtx
§shutdown: Receiver<u64>
A deadline will be sent on this channel if shutdown is requested
deadline: u64
If set to a non-zero value, this is the execution time deadline. The component invocation will trap if it is reached.
Implementations§
Trait Implementations§
Source§impl CabishView for Ctx
impl CabishView for Ctx
fn table(&mut self) -> &mut ResourceTable
Source§impl Host for Ctx
impl Host for Ctx
Source§fn resolution(&mut self) -> Result<Instant>
fn resolution(&mut self) -> Result<Instant>
Query the resolution of the clock. Returns the duration of time
corresponding to a clock tick.
Source§impl Host for Ctx
impl Host for Ctx
Source§fn get_directories(&mut self) -> Result<Vec<(Resource<Descriptor>, String)>>
fn get_directories(&mut self) -> Result<Vec<(Resource<Descriptor>, String)>>
Return the set of preopened directories, and their paths.
Source§impl Host for Ctx
impl Host for Ctx
Source§fn handle(
&mut self,
_request: Resource<OutgoingRequest>,
_options: Option<Resource<WithChildren<RequestOptions>>>,
) -> Result<Result<Resource<FutureIncomingResponse>, ErrorCode>>
fn handle( &mut self, _request: Resource<OutgoingRequest>, _options: Option<Resource<WithChildren<RequestOptions>>>, ) -> Result<Result<Resource<FutureIncomingResponse>, ErrorCode>>
This function is invoked with an outgoing HTTP Request, and it returns
a resource
future-incoming-response
which represents an HTTP Response
which may arrive in the future. Read moreSource§impl Host for Ctx
impl Host for Ctx
Source§fn get_terminal_stdin(&mut self) -> Result<Option<Resource<TerminalInput>>>
fn get_terminal_stdin(&mut self) -> Result<Option<Resource<TerminalInput>>>
If stdin is connected to a terminal, return a
terminal-input
handle
allowing further interaction with it.Source§impl Host for Ctx
impl Host for Ctx
Source§fn create_tcp_socket(
&mut self,
address_family: IpAddressFamily,
) -> Result<Result<Resource<TcpSocket>, ErrorCode>>
fn create_tcp_socket( &mut self, address_family: IpAddressFamily, ) -> Result<Result<Resource<TcpSocket>, ErrorCode>>
Create a new TCP socket. Read more
Source§impl Host for Ctx
impl Host for Ctx
Source§fn create_udp_socket(
&mut self,
address_family: IpAddressFamily,
) -> Result<Result<Resource<UdpSocket>, ErrorCode>>
fn create_udp_socket( &mut self, address_family: IpAddressFamily, ) -> Result<Result<Resource<UdpSocket>, ErrorCode>>
Create a new UDP socket. Read more
Source§impl Host for Ctx
impl Host for Ctx
Source§fn get_terminal_stdout(&mut self) -> Result<Option<Resource<TerminalOutput>>>
fn get_terminal_stdout(&mut self) -> Result<Option<Resource<TerminalOutput>>>
If stdout is connected to a terminal, return a
terminal-output
handle
allowing further interaction with it.Source§impl Host for Ctx
impl Host for Ctx
Source§fn get_terminal_stderr(&mut self) -> Result<Option<Resource<TerminalOutput>>>
fn get_terminal_stderr(&mut self) -> Result<Option<Resource<TerminalOutput>>>
If stderr is connected to a terminal, return a
terminal-output
handle
allowing further interaction with it.Source§impl Host for Ctx
impl Host for Ctx
fn get_stdout(&mut self) -> Result<Resource<OutputStream>>
Source§impl Host for Ctx
impl Host for Ctx
fn get_stderr(&mut self) -> Result<Resource<OutputStream>>
Source§impl Host for Ctx
impl Host for Ctx
Source§impl HostDescriptor for Ctx
impl HostDescriptor for Ctx
Source§fn read_via_stream(
&mut self,
self_: Resource<Descriptor>,
offset: Filesize,
) -> Result<Result<Resource<InputStream>, ErrorCode>>
fn read_via_stream( &mut self, self_: Resource<Descriptor>, offset: Filesize, ) -> Result<Result<Resource<InputStream>, ErrorCode>>
Return a stream for reading from a file, if available. Read more
Source§fn write_via_stream(
&mut self,
self_: Resource<Descriptor>,
offset: Filesize,
) -> Result<Result<Resource<OutputStream>, ErrorCode>>
fn write_via_stream( &mut self, self_: Resource<Descriptor>, offset: Filesize, ) -> Result<Result<Resource<OutputStream>, ErrorCode>>
Return a stream for writing to a file, if available. Read more
Source§fn append_via_stream(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<Resource<OutputStream>, ErrorCode>>
fn append_via_stream( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<Resource<OutputStream>, ErrorCode>>
Return a stream for appending to a file, if available. Read more
Source§fn advise(
&mut self,
self_: Resource<Descriptor>,
offset: Filesize,
length: Filesize,
advice: Advice,
) -> Result<Result<(), ErrorCode>>
fn advise( &mut self, self_: Resource<Descriptor>, offset: Filesize, length: Filesize, advice: Advice, ) -> Result<Result<(), ErrorCode>>
Provide file advisory information on a descriptor. Read more
Source§fn sync_data(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<(), ErrorCode>>
fn sync_data( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<(), ErrorCode>>
Synchronize the data of a file to disk. Read more
Source§fn get_flags(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<DescriptorFlags, ErrorCode>>
fn get_flags( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<DescriptorFlags, ErrorCode>>
Get flags associated with a descriptor. Read more
Source§fn get_type(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<DescriptorType, ErrorCode>>
fn get_type( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<DescriptorType, ErrorCode>>
Get the dynamic type of a descriptor. Read more
Source§fn set_size(
&mut self,
self_: Resource<Descriptor>,
size: Filesize,
) -> Result<Result<(), ErrorCode>>
fn set_size( &mut self, self_: Resource<Descriptor>, size: Filesize, ) -> Result<Result<(), ErrorCode>>
Adjust the size of an open file. If this increases the file’s size, the
extra bytes are filled with zeros. Read more
Source§fn set_times(
&mut self,
self_: Resource<Descriptor>,
data_access_timestamp: NewTimestamp,
data_modification_timestamp: NewTimestamp,
) -> Result<Result<(), ErrorCode>>
fn set_times( &mut self, self_: Resource<Descriptor>, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp, ) -> Result<Result<(), ErrorCode>>
Adjust the timestamps of an open file or directory. Read more
Source§fn read(
&mut self,
self_: Resource<Descriptor>,
length: Filesize,
offset: Filesize,
) -> Result<Result<(Vec<u8>, bool), ErrorCode>>
fn read( &mut self, self_: Resource<Descriptor>, length: Filesize, offset: Filesize, ) -> Result<Result<(Vec<u8>, bool), ErrorCode>>
Read from a descriptor, without using and updating the descriptor’s offset. Read more
Source§fn write(
&mut self,
self_: Resource<Descriptor>,
buffer: Vec<u8>,
offset: Filesize,
) -> Result<Result<Filesize, ErrorCode>>
fn write( &mut self, self_: Resource<Descriptor>, buffer: Vec<u8>, offset: Filesize, ) -> Result<Result<Filesize, ErrorCode>>
Write to a descriptor, without using and updating the descriptor’s offset. Read more
Source§fn read_directory(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<Resource<DirectoryEntryStream>, ErrorCode>>
fn read_directory( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<Resource<DirectoryEntryStream>, ErrorCode>>
Read directory entries from a directory. Read more
Source§fn sync(&mut self, self_: Resource<Descriptor>) -> Result<Result<(), ErrorCode>>
fn sync(&mut self, self_: Resource<Descriptor>) -> Result<Result<(), ErrorCode>>
Synchronize the data and metadata of a file to disk. Read more
Source§fn create_directory_at(
&mut self,
self_: Resource<Descriptor>,
path: String,
) -> Result<Result<(), ErrorCode>>
fn create_directory_at( &mut self, self_: Resource<Descriptor>, path: String, ) -> Result<Result<(), ErrorCode>>
Create a directory. Read more
Source§fn stat(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<DescriptorStat, ErrorCode>>
fn stat( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<DescriptorStat, ErrorCode>>
Return the attributes of an open file or directory. Read more
Source§fn stat_at(
&mut self,
self_: Resource<Descriptor>,
path_flags: PathFlags,
path: String,
) -> Result<Result<DescriptorStat, ErrorCode>>
fn stat_at( &mut self, self_: Resource<Descriptor>, path_flags: PathFlags, path: String, ) -> Result<Result<DescriptorStat, ErrorCode>>
Return the attributes of a file or directory. Read more
Source§fn set_times_at(
&mut self,
self_: Resource<Descriptor>,
path_flags: PathFlags,
path: String,
data_access_timestamp: NewTimestamp,
data_modification_timestamp: NewTimestamp,
) -> Result<Result<(), ErrorCode>>
fn set_times_at( &mut self, self_: Resource<Descriptor>, path_flags: PathFlags, path: String, data_access_timestamp: NewTimestamp, data_modification_timestamp: NewTimestamp, ) -> Result<Result<(), ErrorCode>>
Adjust the timestamps of a file or directory. Read more
Source§fn link_at(
&mut self,
self_: Resource<Descriptor>,
old_path_flags: PathFlags,
old_path: String,
new_descriptor: Resource<Descriptor>,
new_path: String,
) -> Result<Result<(), ErrorCode>>
fn link_at( &mut self, self_: Resource<Descriptor>, old_path_flags: PathFlags, old_path: String, new_descriptor: Resource<Descriptor>, new_path: String, ) -> Result<Result<(), ErrorCode>>
Create a hard link. Read more
Source§fn open_at(
&mut self,
self_: Resource<Descriptor>,
path_flags: PathFlags,
path: String,
open_flags: OpenFlags,
flags: DescriptorFlags,
) -> Result<Result<Resource<Descriptor>, ErrorCode>>
fn open_at( &mut self, self_: Resource<Descriptor>, path_flags: PathFlags, path: String, open_flags: OpenFlags, flags: DescriptorFlags, ) -> Result<Result<Resource<Descriptor>, ErrorCode>>
Open a file or directory. Read more
Source§fn readlink_at(
&mut self,
self_: Resource<Descriptor>,
path: String,
) -> Result<Result<String, ErrorCode>>
fn readlink_at( &mut self, self_: Resource<Descriptor>, path: String, ) -> Result<Result<String, ErrorCode>>
Read the contents of a symbolic link. Read more
Source§fn remove_directory_at(
&mut self,
self_: Resource<Descriptor>,
path: String,
) -> Result<Result<(), ErrorCode>>
fn remove_directory_at( &mut self, self_: Resource<Descriptor>, path: String, ) -> Result<Result<(), ErrorCode>>
Remove a directory. Read more
Source§fn rename_at(
&mut self,
self_: Resource<Descriptor>,
old_path: String,
new_descriptor: Resource<Descriptor>,
new_path: String,
) -> Result<Result<(), ErrorCode>>
fn rename_at( &mut self, self_: Resource<Descriptor>, old_path: String, new_descriptor: Resource<Descriptor>, new_path: String, ) -> Result<Result<(), ErrorCode>>
Rename a filesystem object. Read more
Source§fn symlink_at(
&mut self,
self_: Resource<Descriptor>,
old_path: String,
new_path: String,
) -> Result<Result<(), ErrorCode>>
fn symlink_at( &mut self, self_: Resource<Descriptor>, old_path: String, new_path: String, ) -> Result<Result<(), ErrorCode>>
Create a symbolic link (also known as a “symlink”). Read more
Source§fn unlink_file_at(
&mut self,
self_: Resource<Descriptor>,
path: String,
) -> Result<Result<(), ErrorCode>>
fn unlink_file_at( &mut self, self_: Resource<Descriptor>, path: String, ) -> Result<Result<(), ErrorCode>>
Unlink a filesystem object that is not a directory. Read more
Source§fn is_same_object(
&mut self,
self_: Resource<Descriptor>,
other: Resource<Descriptor>,
) -> Result<bool>
fn is_same_object( &mut self, self_: Resource<Descriptor>, other: Resource<Descriptor>, ) -> Result<bool>
Test whether two descriptors refer to the same filesystem object. Read more
Source§fn metadata_hash(
&mut self,
self_: Resource<Descriptor>,
) -> Result<Result<MetadataHashValue, ErrorCode>>
fn metadata_hash( &mut self, self_: Resource<Descriptor>, ) -> Result<Result<MetadataHashValue, ErrorCode>>
Return a hash of the metadata associated with a filesystem object referred
to by a descriptor. Read more
Source§fn metadata_hash_at(
&mut self,
self_: Resource<Descriptor>,
path_flags: PathFlags,
path: String,
) -> Result<Result<MetadataHashValue, ErrorCode>>
fn metadata_hash_at( &mut self, self_: Resource<Descriptor>, path_flags: PathFlags, path: String, ) -> Result<Result<MetadataHashValue, ErrorCode>>
Return a hash of the metadata associated with a filesystem object referred
to by a directory descriptor and a relative path. Read more
fn drop(&mut self, rep: Resource<Descriptor>) -> Result<()>
Source§impl HostDirectoryEntryStream for Ctx
impl HostDirectoryEntryStream for Ctx
Source§fn read_directory_entry(
&mut self,
self_: Resource<DirectoryEntryStream>,
) -> Result<Result<Option<DirectoryEntry>, ErrorCode>>
fn read_directory_entry( &mut self, self_: Resource<DirectoryEntryStream>, ) -> Result<Result<Option<DirectoryEntry>, ErrorCode>>
Read a single directory entry from a
directory-entry-stream
.fn drop(&mut self, rep: Resource<DirectoryEntryStream>) -> Result<()>
Source§impl HostFields for Ctx
impl HostFields for Ctx
Source§fn new(&mut self) -> Result<Resource<WithChildren<HeaderMap>>>
fn new(&mut self) -> Result<Resource<WithChildren<HeaderMap>>>
Construct an empty HTTP Fields. Read more
Source§fn from_list(
&mut self,
entries: Vec<(FieldName, FieldValue)>,
) -> Result<Result<Resource<WithChildren<HeaderMap>>, HeaderError>>
fn from_list( &mut self, entries: Vec<(FieldName, FieldValue)>, ) -> Result<Result<Resource<WithChildren<HeaderMap>>, HeaderError>>
Construct an HTTP Fields. Read more
Source§fn get(
&mut self,
fields: Resource<WithChildren<HeaderMap>>,
name: FieldName,
) -> Result<Vec<FieldValue>>
fn get( &mut self, fields: Resource<WithChildren<HeaderMap>>, name: FieldName, ) -> Result<Vec<FieldValue>>
Get all of the values corresponding to a name. If the name is not present
in this
fields
or is syntactically invalid, 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<WithChildren<HeaderMap>>,
name: FieldName,
) -> Result<bool>
fn has( &mut self, fields: Resource<WithChildren<HeaderMap>>, 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<WithChildren<HeaderMap>>,
name: FieldName,
value: Vec<FieldValue>,
) -> Result<Result<(), HeaderError>>
fn set( &mut self, fields: Resource<WithChildren<HeaderMap>>, name: FieldName, value: Vec<FieldValue>, ) -> Result<Result<(), 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<WithChildren<HeaderMap>>,
name: FieldName,
) -> Result<Result<(), HeaderError>>
fn delete( &mut self, fields: Resource<WithChildren<HeaderMap>>, name: FieldName, ) -> Result<Result<(), 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<WithChildren<HeaderMap>>,
name: FieldName,
value: FieldValue,
) -> Result<Result<(), HeaderError>>
fn append( &mut self, fields: Resource<WithChildren<HeaderMap>>, name: FieldName, value: FieldValue, ) -> Result<Result<(), HeaderError>>
Append a value for a name. Does not change or delete any existing
values for that name. Read more
Source§fn entries(
&mut self,
fields: Resource<WithChildren<HeaderMap>>,
) -> Result<Vec<(FieldName, FieldValue)>>
fn entries( &mut self, fields: Resource<WithChildren<HeaderMap>>, ) -> 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<WithChildren<HeaderMap>>,
) -> Result<Resource<WithChildren<HeaderMap>>>
fn clone( &mut self, fields: Resource<WithChildren<HeaderMap>>, ) -> Result<Resource<WithChildren<HeaderMap>>>
Make a deep copy of the Fields. Equivalent in behavior to calling the
fields
constructor on the return value of entries
. The resulting
fields
is mutable.fn drop(&mut self, fields: Resource<WithChildren<HeaderMap>>) -> Result<()>
Source§impl HostFutureIncomingResponse for Ctx
impl HostFutureIncomingResponse for Ctx
Source§fn subscribe(
&mut self,
self_: Resource<FutureIncomingResponse>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<FutureIncomingResponse>, ) -> Result<Resource<Pollable>>
Returns a pollable which becomes ready when either the Response has
been received, or an error has occurred. When this pollable is ready,
the
get
method will return some
.Source§fn get(
&mut self,
self_: Resource<FutureIncomingResponse>,
) -> Result<Option<Result<Result<Resource<IncomingResponse>, ErrorCode>, ()>>>
fn get( &mut self, self_: Resource<FutureIncomingResponse>, ) -> Result<Option<Result<Result<Resource<IncomingResponse>, ErrorCode>, ()>>>
Returns the incoming HTTP Response, or an error, once one is ready. Read more
fn drop(&mut self, rep: Resource<FutureIncomingResponse>) -> Result<()>
Source§impl HostFutureTrailers for Ctx
impl HostFutureTrailers for Ctx
Source§fn subscribe(
&mut self,
trailers: Resource<FutureTrailers>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, trailers: Resource<FutureTrailers>, ) -> Result<Resource<Pollable>>
Returns a pollable which becomes ready when either the trailers have
been received, or an error has occurred. When this pollable is ready,
the
get
method will return some
.Source§fn get(
&mut self,
trailers: Resource<FutureTrailers>,
) -> Result<Option<Result<Result<Option<Resource<Trailers>>, ErrorCode>, ()>>>
fn get( &mut self, trailers: Resource<FutureTrailers>, ) -> Result<Option<Result<Result<Option<Resource<Trailers>>, ErrorCode>, ()>>>
Returns the contents of the trailers, or an error which occurred,
once the future is ready. Read more
fn drop(&mut self, trailers: Resource<FutureTrailers>) -> Result<()>
Source§impl HostIncomingBody for Ctx
impl HostIncomingBody for Ctx
Source§fn stream(
&mut self,
body: Resource<IncomingBody>,
) -> Result<Result<Resource<InputStream>, ()>>
fn stream( &mut self, body: Resource<IncomingBody>, ) -> Result<Result<Resource<InputStream>, ()>>
Returns the contents of the body, as a stream of bytes. Read more
Source§fn finish(
&mut self,
body: Resource<IncomingBody>,
) -> Result<Resource<FutureTrailers>>
fn finish( &mut self, body: Resource<IncomingBody>, ) -> Result<Resource<FutureTrailers>>
Takes ownership of
incoming-body
, and returns a future-trailers
.
This function will trap if the input-stream
child is still alive.fn drop(&mut self, body: Resource<IncomingBody>) -> Result<()>
Source§impl HostIncomingDatagramStream for Ctx
impl HostIncomingDatagramStream for Ctx
Source§fn receive(
&mut self,
self_: Resource<IncomingDatagramStream>,
max_results: u64,
) -> Result<Result<Vec<IncomingDatagram>, ErrorCode>>
fn receive( &mut self, self_: Resource<IncomingDatagramStream>, max_results: u64, ) -> Result<Result<Vec<IncomingDatagram>, ErrorCode>>
Receive messages on the socket. Read more
Source§fn subscribe(
&mut self,
self_: Resource<IncomingDatagramStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<IncomingDatagramStream>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the stream is ready to receive again. Read morefn drop(&mut self, rep: Resource<IncomingDatagramStream>) -> Result<()>
Source§impl HostIncomingRequest for Ctx
impl HostIncomingRequest for Ctx
Source§fn consume(
&mut self,
req: Resource<IncomingRequest>,
) -> Result<Result<Resource<IncomingBody>, ()>>
fn consume( &mut self, req: Resource<IncomingRequest>, ) -> Result<Result<Resource<IncomingBody>, ()>>
Gives the
incoming-body
associated with this request. Will only
return success at most once, and subsequent calls will return error.Source§fn method(&mut self, req: Resource<IncomingRequest>) -> Result<Method>
fn method(&mut self, req: Resource<IncomingRequest>) -> Result<Method>
Returns the method of the incoming request.
Source§fn path_with_query(
&mut self,
req: Resource<IncomingRequest>,
) -> Result<Option<String>>
fn path_with_query( &mut self, req: Resource<IncomingRequest>, ) -> Result<Option<String>>
Returns the path with query parameters from the request, as a string.
Source§fn scheme(&mut self, req: Resource<IncomingRequest>) -> Result<Option<Scheme>>
fn scheme(&mut self, req: Resource<IncomingRequest>) -> Result<Option<Scheme>>
Returns the protocol scheme from the request.
Returns the authority of the Request’s target URI, if present.
Source§fn headers(
&mut self,
req: Resource<IncomingRequest>,
) -> Result<Resource<WithChildren<HeaderMap>>>
fn headers( &mut self, req: Resource<IncomingRequest>, ) -> Result<Resource<WithChildren<HeaderMap>>>
Get the
headers
associated with the request. Read morefn drop(&mut self, req: Resource<IncomingRequest>) -> Result<()>
Source§impl HostIncomingResponse for Ctx
impl HostIncomingResponse for Ctx
Source§fn status(&mut self, res: Resource<IncomingResponse>) -> Result<StatusCode>
fn status(&mut self, res: Resource<IncomingResponse>) -> Result<StatusCode>
Returns the status code from the incoming response.
Source§fn consume(
&mut self,
self_: Resource<IncomingResponse>,
) -> Result<Result<Resource<IncomingBody>, ()>>
fn consume( &mut self, self_: Resource<IncomingResponse>, ) -> Result<Result<Resource<IncomingBody>, ()>>
Returns the incoming body. May be called at most once. Returns error
if called additional times.
Source§fn headers(
&mut self,
res: Resource<IncomingResponse>,
) -> Result<Resource<WithChildren<HeaderMap>>>
fn headers( &mut self, res: Resource<IncomingResponse>, ) -> Result<Resource<WithChildren<HeaderMap>>>
Returns the headers from the incoming response. Read more
fn drop(&mut self, res: Resource<IncomingResponse>) -> Result<()>
Source§impl HostInputStream for Ctx
impl HostInputStream for Ctx
Source§fn read(
&mut self,
stream: Resource<InputStream>,
len: u64,
) -> Result<Result<Vec<u8>, StreamError>>
fn read( &mut self, stream: Resource<InputStream>, len: u64, ) -> Result<Result<Vec<u8>, StreamError>>
Perform a non-blocking read from the stream. Read more
Source§async fn blocking_read(
&mut self,
stream: Resource<InputStream>,
len: u64,
) -> Result<Result<Vec<u8>, StreamError>>
async fn blocking_read( &mut self, stream: Resource<InputStream>, len: u64, ) -> Result<Result<Vec<u8>, StreamError>>
Read bytes from a stream, after blocking until at least one byte can
be read. Except for blocking, behavior is identical to
read
.Source§fn skip(
&mut self,
stream: Resource<InputStream>,
len: u64,
) -> Result<Result<u64, StreamError>>
fn skip( &mut self, stream: Resource<InputStream>, len: u64, ) -> Result<Result<u64, StreamError>>
Skip bytes from a stream. Returns number of bytes skipped. Read more
Source§async fn blocking_skip(
&mut self,
stream: Resource<InputStream>,
len: u64,
) -> Result<Result<u64, StreamError>>
async fn blocking_skip( &mut self, stream: Resource<InputStream>, len: u64, ) -> Result<Result<u64, StreamError>>
Skip bytes from a stream, after blocking until at least one byte
can be skipped. Except for blocking behavior, identical to
skip
.Source§fn subscribe(
&mut self,
stream: Resource<InputStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, stream: Resource<InputStream>, ) -> Result<Resource<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.
The created pollable
is a child resource of the input-stream
.
Implementations may trap if the input-stream
is dropped before
all derived pollable
s created with this function are dropped.fn drop(&mut self, stream: Resource<InputStream>) -> Result<()>
Source§impl HostOutgoingBody for Ctx
impl HostOutgoingBody for Ctx
Source§fn write(
&mut self,
body: Resource<Arc<Mutex<OutgoingBody>>>,
) -> Result<Result<Resource<OutputStream>, ()>>
fn write( &mut self, body: Resource<Arc<Mutex<OutgoingBody>>>, ) -> Result<Result<Resource<OutputStream>, ()>>
Returns a stream for writing the body contents. Read more
Source§fn finish(
&mut self,
body: Resource<Arc<Mutex<OutgoingBody>>>,
trailers: Option<Resource<Trailers>>,
) -> Result<Result<(), ErrorCode>>
fn finish( &mut self, body: Resource<Arc<Mutex<OutgoingBody>>>, trailers: Option<Resource<Trailers>>, ) -> Result<Result<(), ErrorCode>>
Finalize an outgoing body, optionally providing trailers. This must be
called to signal that the response is complete. If the
outgoing-body
is dropped without calling outgoing-body.finalize
, the implementation
should treat the body as corrupted. Read morefn drop(&mut self, body: Resource<Arc<Mutex<OutgoingBody>>>) -> Result<()>
Source§impl HostOutgoingDatagramStream for Ctx
impl HostOutgoingDatagramStream for Ctx
Source§fn check_send(
&mut self,
self_: Resource<OutgoingDatagramStream>,
) -> Result<Result<u64, ErrorCode>>
fn check_send( &mut self, self_: Resource<OutgoingDatagramStream>, ) -> Result<Result<u64, ErrorCode>>
Check readiness for sending. This function never blocks. Read more
Source§fn send(
&mut self,
self_: Resource<OutgoingDatagramStream>,
datagrams: Vec<OutgoingDatagram>,
) -> Result<Result<u64, ErrorCode>>
fn send( &mut self, self_: Resource<OutgoingDatagramStream>, datagrams: Vec<OutgoingDatagram>, ) -> Result<Result<u64, ErrorCode>>
Send messages on the socket. Read more
Source§fn subscribe(
&mut self,
self_: Resource<OutgoingDatagramStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<OutgoingDatagramStream>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the stream is ready to send again. Read morefn drop(&mut self, rep: Resource<OutgoingDatagramStream>) -> Result<()>
Source§impl HostOutgoingRequest for Ctx
impl HostOutgoingRequest for Ctx
Source§fn new(
&mut self,
headers: Resource<WithChildren<HeaderMap>>,
) -> Result<Resource<OutgoingRequest>>
fn new( &mut self, headers: Resource<WithChildren<HeaderMap>>, ) -> Result<Resource<OutgoingRequest>>
Construct a new
outgoing-request
with a default method
of GET
, and
none
values for path-with-query
, scheme
, and authority
. Read moreSource§fn body(
&mut self,
self_: Resource<OutgoingRequest>,
) -> Result<Result<Resource<Arc<Mutex<OutgoingBody>>>, ()>>
fn body( &mut self, self_: Resource<OutgoingRequest>, ) -> Result<Result<Resource<Arc<Mutex<OutgoingBody>>>, ()>>
Returns the resource corresponding to the outgoing Body for this
Request. Read more
Source§fn method(&mut self, req: Resource<OutgoingRequest>) -> Result<Method>
fn method(&mut self, req: Resource<OutgoingRequest>) -> Result<Method>
Get the Method for the Request.
Source§fn set_method(
&mut self,
req: Resource<OutgoingRequest>,
method: Method,
) -> Result<Result<(), ()>>
fn set_method( &mut self, req: Resource<OutgoingRequest>, 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 path_with_query(
&mut self,
req: Resource<OutgoingRequest>,
) -> Result<Option<String>>
fn path_with_query( &mut self, req: Resource<OutgoingRequest>, ) -> 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<OutgoingRequest>,
path_with_query: Option<String>,
) -> Result<Result<(), ()>>
fn set_path_with_query( &mut self, req: Resource<OutgoingRequest>, 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 scheme(&mut self, req: Resource<OutgoingRequest>) -> Result<Option<Scheme>>
fn scheme(&mut self, req: Resource<OutgoingRequest>) -> 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<OutgoingRequest>,
scheme: Option<Scheme>,
) -> Result<Result<(), ()>>
fn set_scheme( &mut self, req: Resource<OutgoingRequest>, 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.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.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 headers(
&mut self,
req: Resource<OutgoingRequest>,
) -> Result<Resource<WithChildren<HeaderMap>>>
fn headers( &mut self, req: Resource<OutgoingRequest>, ) -> Result<Resource<WithChildren<HeaderMap>>>
Get the headers associated with the Request. Read more
fn drop(&mut self, req: Resource<OutgoingRequest>) -> Result<()>
Source§impl HostOutgoingResponse for Ctx
impl HostOutgoingResponse for Ctx
Source§fn new(
&mut self,
headers: Resource<WithChildren<HeaderMap>>,
) -> Result<Resource<OutgoingResponse>>
fn new( &mut self, headers: Resource<WithChildren<HeaderMap>>, ) -> Result<Resource<OutgoingResponse>>
Construct an
outgoing-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 body(
&mut self,
res: Resource<OutgoingResponse>,
) -> Result<Result<Resource<Arc<Mutex<OutgoingBody>>>, ()>>
fn body( &mut self, res: Resource<OutgoingResponse>, ) -> Result<Result<Resource<Arc<Mutex<OutgoingBody>>>, ()>>
Returns the resource corresponding to the outgoing Body for this Response. Read more
Source§fn status_code(&mut self, res: Resource<OutgoingResponse>) -> Result<StatusCode>
fn status_code(&mut self, res: Resource<OutgoingResponse>) -> Result<StatusCode>
Get the HTTP Status Code for the Response.
Source§fn set_status_code(
&mut self,
res: Resource<OutgoingResponse>,
status_code: StatusCode,
) -> Result<Result<(), ()>>
fn set_status_code( &mut self, res: Resource<OutgoingResponse>, 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 headers(
&mut self,
res: Resource<OutgoingResponse>,
) -> Result<Resource<WithChildren<HeaderMap>>>
fn headers( &mut self, res: Resource<OutgoingResponse>, ) -> Result<Resource<WithChildren<HeaderMap>>>
Get the headers associated with the Request. Read more
fn drop(&mut self, res: Resource<OutgoingResponse>) -> Result<()>
Source§impl HostOutputStream for Ctx
impl HostOutputStream for Ctx
Source§fn check_write(
&mut self,
stream: Resource<OutputStream>,
) -> Result<Result<u64, StreamError>>
fn check_write( &mut self, stream: Resource<OutputStream>, ) -> Result<Result<u64, StreamError>>
Check readiness for writing. This function never blocks. Read more
Source§fn write(
&mut self,
stream: Resource<OutputStream>,
contents: Vec<u8>,
) -> Result<Result<(), StreamError>>
fn write( &mut self, stream: Resource<OutputStream>, contents: Vec<u8>, ) -> Result<Result<(), StreamError>>
Perform a write. This function never blocks. Read more
Source§async fn blocking_write_and_flush(
&mut self,
stream: Resource<OutputStream>,
contents: Vec<u8>,
) -> Result<Result<(), StreamError>>
async fn blocking_write_and_flush( &mut self, stream: Resource<OutputStream>, contents: Vec<u8>, ) -> Result<Result<(), StreamError>>
Perform a write of up to 4096 bytes, and then flush the stream. Block
until all of these operations are complete, or an error occurs. Read more
Source§fn flush(
&mut self,
stream: Resource<OutputStream>,
) -> Result<Result<(), StreamError>>
fn flush( &mut self, stream: Resource<OutputStream>, ) -> Result<Result<(), StreamError>>
Request to flush buffered output. This function never blocks. Read more
Source§async fn blocking_flush(
&mut self,
stream: Resource<OutputStream>,
) -> Result<Result<(), StreamError>>
async fn blocking_flush( &mut self, stream: Resource<OutputStream>, ) -> Result<Result<(), StreamError>>
Request to flush buffered output, and block until flush completes
and stream is ready for writing again.
Source§fn subscribe(
&mut self,
stream: Resource<OutputStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, stream: Resource<OutputStream>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the output-stream
is ready for more writing, or an error has occurred. When this
pollable is ready, check-write
will return ok(n)
with n>0, or an
error. Read moreSource§fn write_zeroes(
&mut self,
stream: Resource<OutputStream>,
len: u64,
) -> Result<Result<(), StreamError>>
fn write_zeroes( &mut self, stream: Resource<OutputStream>, len: u64, ) -> Result<Result<(), StreamError>>
Write zeroes to a stream. Read more
Source§async fn blocking_write_zeroes_and_flush(
&mut self,
stream: Resource<OutputStream>,
len: u64,
) -> Result<Result<(), StreamError>>
async fn blocking_write_zeroes_and_flush( &mut self, stream: Resource<OutputStream>, len: u64, ) -> Result<Result<(), StreamError>>
Perform a write of up to 4096 zeroes, and then flush the stream.
Block until all of these operations are complete, or an error
occurs. Read more
Source§fn splice(
&mut self,
stream: Resource<OutputStream>,
src: Resource<InputStream>,
len: u64,
) -> Result<Result<u64, StreamError>>
fn splice( &mut self, stream: Resource<OutputStream>, src: Resource<InputStream>, len: u64, ) -> Result<Result<u64, StreamError>>
Read from one stream and write to another. Read more
Source§async fn blocking_splice(
&mut self,
stream: Resource<OutputStream>,
src: Resource<InputStream>,
len: u64,
) -> Result<Result<u64, StreamError>>
async fn blocking_splice( &mut self, stream: Resource<OutputStream>, src: Resource<InputStream>, len: u64, ) -> Result<Result<u64, StreamError>>
Read from one stream and write to another, with blocking. Read more
fn drop(&mut self, stream: Resource<OutputStream>) -> Result<()>
Source§impl HostPollable for Ctx
impl HostPollable for Ctx
Source§fn ready(&mut self, pollable: Resource<Pollable>) -> Result<bool>
fn ready(&mut self, pollable: Resource<Pollable>) -> Result<bool>
Return the readiness of a pollable. This function never blocks. Read more
Source§async fn block(&mut self, pollable: Resource<Pollable>) -> Result<()>
async fn block(&mut self, pollable: Resource<Pollable>) -> Result<()>
block
returns immediately if the pollable is ready, and otherwise
blocks until ready. Read morefn drop(&mut self, pollable: Resource<Pollable>) -> Result<()>
Source§impl HostRequestOptions for Ctx
impl HostRequestOptions for Ctx
Source§fn new(&mut self) -> Result<Resource<WithChildren<RequestOptions>>>
fn new(&mut self) -> Result<Resource<WithChildren<RequestOptions>>>
Construct a default
request-options
value.Source§fn connect_timeout(
&mut self,
opts: Resource<WithChildren<RequestOptions>>,
) -> Result<Option<Duration>>
fn connect_timeout( &mut self, opts: Resource<WithChildren<RequestOptions>>, ) -> Result<Option<Duration>>
The timeout for the initial connect to the HTTP Server.
Source§fn set_connect_timeout(
&mut self,
opts: Resource<WithChildren<RequestOptions>>,
duration: Option<Duration>,
) -> Result<Result<(), ()>>
fn set_connect_timeout( &mut self, opts: Resource<WithChildren<RequestOptions>>, duration: Option<Duration>, ) -> Result<Result<(), ()>>
Set the timeout for the initial connect to the HTTP Server. An error
return value indicates that this timeout is not supported.
Source§fn first_byte_timeout(
&mut self,
opts: Resource<WithChildren<RequestOptions>>,
) -> Result<Option<Duration>>
fn first_byte_timeout( &mut self, opts: Resource<WithChildren<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<WithChildren<RequestOptions>>,
duration: Option<Duration>,
) -> Result<Result<(), ()>>
fn set_first_byte_timeout( &mut self, opts: Resource<WithChildren<RequestOptions>>, duration: Option<Duration>, ) -> Result<Result<(), ()>>
Set the timeout for receiving the first byte of the Response body. An
error return value indicates that this timeout is not supported.
Source§fn between_bytes_timeout(
&mut self,
opts: Resource<WithChildren<RequestOptions>>,
) -> Result<Option<Duration>>
fn between_bytes_timeout( &mut self, opts: Resource<WithChildren<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<WithChildren<RequestOptions>>,
duration: Option<Duration>,
) -> Result<Result<(), ()>>
fn set_between_bytes_timeout( &mut self, opts: Resource<WithChildren<RequestOptions>>, duration: Option<Duration>, ) -> Result<Result<(), ()>>
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.
fn drop(&mut self, opts: Resource<WithChildren<RequestOptions>>) -> Result<()>
Source§impl HostResolveAddressStream for Ctx
impl HostResolveAddressStream for Ctx
Source§fn resolve_next_address(
&mut self,
self_: Resource<ResolveAddressStream>,
) -> Result<Result<Option<IpAddress>, ErrorCode>>
fn resolve_next_address( &mut self, self_: Resource<ResolveAddressStream>, ) -> Result<Result<Option<IpAddress>, ErrorCode>>
Returns the next address from the resolver. Read more
Source§fn subscribe(
&mut self,
self_: Resource<ResolveAddressStream>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<ResolveAddressStream>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the stream is ready for I/O. Read morefn drop(&mut self, rep: Resource<ResolveAddressStream>) -> Result<()>
Source§impl HostResponseOutparam for Ctx
impl HostResponseOutparam for Ctx
Source§fn send_informational(
&mut self,
self_: Resource<ResponseOutparam>,
status: u16,
headers: Resource<WithChildren<HeaderMap>>,
) -> Result<Result<(), ErrorCode>>
fn send_informational( &mut self, self_: Resource<ResponseOutparam>, status: u16, headers: Resource<WithChildren<HeaderMap>>, ) -> Result<Result<(), ErrorCode>>
Send an HTTP 1xx response. Read more
Source§fn set(
&mut self,
param: Resource<ResponseOutparam>,
response: Result<Resource<OutgoingResponse>, ErrorCode>,
) -> Result<()>
fn set( &mut self, param: Resource<ResponseOutparam>, response: Result<Resource<OutgoingResponse>, ErrorCode>, ) -> Result<()>
Set the value of the
response-outparam
to either send a response,
or indicate an error. Read morefn drop(&mut self, param: Resource<ResponseOutparam>) -> Result<()>
Source§impl HostTcpSocket for Ctx
impl HostTcpSocket for Ctx
Source§fn start_bind(
&mut self,
socket: Resource<TcpSocket>,
_network: Resource<Network>,
local_address: IpSocketAddress,
) -> Result<Result<(), ErrorCode>>
fn start_bind( &mut self, socket: Resource<TcpSocket>, _network: Resource<Network>, local_address: IpSocketAddress, ) -> Result<Result<(), ErrorCode>>
Bind the socket to a specific network on the provided IP address and port. Read more
fn finish_bind( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<(), ErrorCode>>
Source§fn start_connect(
&mut self,
socket: Resource<TcpSocket>,
_network: Resource<Network>,
remote_address: IpSocketAddress,
) -> Result<Result<(), ErrorCode>>
fn start_connect( &mut self, socket: Resource<TcpSocket>, _network: Resource<Network>, remote_address: IpSocketAddress, ) -> Result<Result<(), ErrorCode>>
Connect to a remote endpoint. Read more
fn finish_connect( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<(Resource<InputStream>, Resource<OutputStream>), ErrorCode>>
Source§fn start_listen(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<(), ErrorCode>>
fn start_listen( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<(), ErrorCode>>
Start listening for new connections. Read more
fn finish_listen( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<(), ErrorCode>>
Source§fn accept(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<(Resource<TcpSocket>, Resource<InputStream>, Resource<OutputStream>), ErrorCode>>
fn accept( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<(Resource<TcpSocket>, Resource<InputStream>, Resource<OutputStream>), ErrorCode>>
Accept a new client socket. Read more
Source§fn subscribe(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, socket: Resource<TcpSocket>, ) -> Result<Resource<Pollable>>
Create a
pollable
which can be used to poll for, or block on,
completion of any of the asynchronous operations of this socket. Read moreSource§fn shutdown(
&mut self,
socket: Resource<TcpSocket>,
shutdown_type: ShutdownType,
) -> Result<Result<(), ErrorCode>>
fn shutdown( &mut self, socket: Resource<TcpSocket>, shutdown_type: ShutdownType, ) -> Result<Result<(), ErrorCode>>
Initiate a graceful shutdown. Read more
Source§fn local_address(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<IpSocketAddress, ErrorCode>>
fn local_address( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<IpSocketAddress, ErrorCode>>
Get the bound local address. Read more
Source§fn remote_address(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<IpSocketAddress, ErrorCode>>
fn remote_address( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<IpSocketAddress, ErrorCode>>
Get the remote address. Read more
Source§fn is_listening(&mut self, socket: Resource<TcpSocket>) -> Result<bool>
fn is_listening(&mut self, socket: Resource<TcpSocket>) -> Result<bool>
Whether the socket is in the
listening
state. Read moreSource§fn address_family(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<IpAddressFamily>
fn address_family( &mut self, socket: Resource<TcpSocket>, ) -> Result<IpAddressFamily>
Whether this is a IPv4 or IPv6 socket. Read more
Source§fn set_listen_backlog_size(
&mut self,
socket: Resource<TcpSocket>,
value: u64,
) -> Result<Result<(), ErrorCode>>
fn set_listen_backlog_size( &mut self, socket: Resource<TcpSocket>, value: u64, ) -> Result<Result<(), ErrorCode>>
Hints the desired listen queue size. Implementations are free to ignore this. Read more
Source§fn keep_alive_enabled(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<bool, ErrorCode>>
fn keep_alive_enabled( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<bool, ErrorCode>>
Enables or disables keepalive. Read more
fn set_keep_alive_enabled( &mut self, socket: Resource<TcpSocket>, value: bool, ) -> Result<Result<(), ErrorCode>>
Source§fn keep_alive_idle_time(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<Duration, ErrorCode>>
fn keep_alive_idle_time( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<Duration, ErrorCode>>
Amount of time the connection has to be idle before TCP starts sending keepalive packets. Read more
fn set_keep_alive_idle_time( &mut self, socket: Resource<TcpSocket>, value: Duration, ) -> Result<Result<(), ErrorCode>>
Source§fn keep_alive_interval(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<Duration, ErrorCode>>
fn keep_alive_interval( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<Duration, ErrorCode>>
The time between keepalive packets. Read more
fn set_keep_alive_interval( &mut self, socket: Resource<TcpSocket>, value: Duration, ) -> Result<Result<(), ErrorCode>>
Source§fn keep_alive_count(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<u32, ErrorCode>>
fn keep_alive_count( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<u32, ErrorCode>>
The maximum amount of keepalive packets TCP should send before aborting the connection. Read more
fn set_keep_alive_count( &mut self, socket: Resource<TcpSocket>, value: u32, ) -> Result<Result<(), ErrorCode>>
Source§fn hop_limit(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<u8, ErrorCode>>
fn hop_limit( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<u8, ErrorCode>>
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
fn set_hop_limit( &mut self, socket: Resource<TcpSocket>, value: u8, ) -> Result<Result<(), ErrorCode>>
Source§fn receive_buffer_size(
&mut self,
socket: Resource<TcpSocket>,
) -> Result<Result<u64, ErrorCode>>
fn receive_buffer_size( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<u64, ErrorCode>>
The kernel buffer space reserved for sends/receives on this socket. Read more
fn set_receive_buffer_size( &mut self, socket: Resource<TcpSocket>, value: u64, ) -> Result<Result<(), ErrorCode>>
fn send_buffer_size( &mut self, socket: Resource<TcpSocket>, ) -> Result<Result<u64, ErrorCode>>
fn set_send_buffer_size( &mut self, socket: Resource<TcpSocket>, value: u64, ) -> Result<Result<(), ErrorCode>>
fn drop(&mut self, socket: Resource<TcpSocket>) -> Result<()>
Source§impl HostTerminalInput for Ctx
impl HostTerminalInput for Ctx
Source§impl HostTerminalOutput for Ctx
impl HostTerminalOutput for Ctx
Source§impl HostUdpSocket for Ctx
impl HostUdpSocket for Ctx
Source§fn start_bind(
&mut self,
self_: Resource<UdpSocket>,
network: Resource<Network>,
local_address: IpSocketAddress,
) -> Result<Result<(), ErrorCode>>
fn start_bind( &mut self, self_: Resource<UdpSocket>, network: Resource<Network>, local_address: IpSocketAddress, ) -> Result<Result<(), ErrorCode>>
Bind the socket to a specific network on the provided IP address and port. Read more
fn finish_bind( &mut self, self_: Resource<UdpSocket>, ) -> Result<Result<(), ErrorCode>>
Source§fn stream(
&mut self,
self_: Resource<UdpSocket>,
remote_address: Option<IpSocketAddress>,
) -> Result<Result<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>), ErrorCode>>
fn stream( &mut self, self_: Resource<UdpSocket>, remote_address: Option<IpSocketAddress>, ) -> Result<Result<(Resource<IncomingDatagramStream>, Resource<OutgoingDatagramStream>), ErrorCode>>
Set up inbound & outbound communication channels, optionally to a specific peer. Read more
Source§fn subscribe(
&mut self,
self_: Resource<UdpSocket>,
) -> Result<Resource<Pollable>>
fn subscribe( &mut self, self_: Resource<UdpSocket>, ) -> Result<Resource<Pollable>>
Create a
pollable
which will resolve once the socket is ready for I/O. Read moreSource§fn local_address(
&mut self,
socket: Resource<UdpSocket>,
) -> Result<Result<IpSocketAddress, ErrorCode>>
fn local_address( &mut self, socket: Resource<UdpSocket>, ) -> Result<Result<IpSocketAddress, ErrorCode>>
Get the current bound address. Read more
Source§fn remote_address(
&mut self,
socket: Resource<UdpSocket>,
) -> Result<Result<IpSocketAddress, ErrorCode>>
fn remote_address( &mut self, socket: Resource<UdpSocket>, ) -> Result<Result<IpSocketAddress, ErrorCode>>
Get the address the socket is currently streaming to. Read more
Source§fn address_family(
&mut self,
socket: Resource<UdpSocket>,
) -> Result<IpAddressFamily>
fn address_family( &mut self, socket: Resource<UdpSocket>, ) -> Result<IpAddressFamily>
Whether this is a IPv4 or IPv6 socket. Read more
Source§fn unicast_hop_limit(
&mut self,
socket: Resource<UdpSocket>,
) -> Result<Result<u8, ErrorCode>>
fn unicast_hop_limit( &mut self, socket: Resource<UdpSocket>, ) -> Result<Result<u8, ErrorCode>>
Equivalent to the IP_TTL & IPV6_UNICAST_HOPS socket options. Read more
fn set_unicast_hop_limit( &mut self, socket: Resource<UdpSocket>, value: u8, ) -> Result<Result<(), ErrorCode>>
Source§fn receive_buffer_size(
&mut self,
socket: Resource<UdpSocket>,
) -> Result<Result<u64, ErrorCode>>
fn receive_buffer_size( &mut self, socket: Resource<UdpSocket>, ) -> Result<Result<u64, ErrorCode>>
The kernel buffer space reserved for sends/receives on this socket. Read more
fn set_receive_buffer_size( &mut self, socket: Resource<UdpSocket>, value: u64, ) -> Result<Result<(), ErrorCode>>
fn send_buffer_size( &mut self, socket: Resource<UdpSocket>, ) -> Result<Result<u64, ErrorCode>>
fn set_send_buffer_size( &mut self, socket: Resource<UdpSocket>, value: u64, ) -> Result<Result<(), ErrorCode>>
fn drop(&mut self, socket: Resource<UdpSocket>) -> Result<()>
impl Host for Ctx
impl Host for Ctx
impl Host for Ctx
impl Host for Ctx
impl Host for Ctx
impl Host for Ctx
Auto Trait Implementations§
impl Freeze for Ctx
impl !RefUnwindSafe for Ctx
impl Send for Ctx
impl !Sync for Ctx
impl Unpin for Ctx
impl !UnwindSafe for Ctx
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
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§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.Source§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,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
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 moreSource§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 more