Struct salt::Context [] [src]

pub struct Context { /* fields omitted */ }

Context represents the context of the current HTTP request.

A Context consists of: - A Handle referencing the event loop in which this request is being handled. - The current HTTP Request.

Methods

impl Context
[src]

Return a reference to a handle to the event loop this Context is associated with.

Returns a reference to the request HTTP version.

Returns a reference to the request headers.

Returns a reference to the request HTTP method.

Returns a reference to the request URI.

Returns a reference to the request path.

Returns a reference to the request body.

Methods from Deref<Target = Handle>

Returns a reference to the underlying remote handle to the event loop.

Spawns a new future on the event loop this handle is associated with.

Spawns a closure on this event loop.

This function is a convenience wrapper around the spawn function above for running a closure wrapped in futures::lazy. It will spawn the function f provided onto the event loop, and continue to run the future returned by f on the event loop as well.

Return the ID of the represented Core

Trait Implementations

impl Deref for Context
[src]

The resulting type after dereferencing

The method called to dereference a value

impl Read for Context
[src]

Pull some bytes from this source into the specified buffer, returning how many bytes were read. Read more

🔬 This is a nightly-only experimental API. (read_initializer)

Determines if this Reader can work with buffers of uninitialized memory. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read all bytes until EOF in this source, placing them into buf. Read more

Read the exact number of bytes required to fill buf. Read more

Creates a "by reference" adaptor for this instance of Read. Read more

Transforms this Read instance to an Iterator over its bytes. Read more

🔬 This is a nightly-only experimental API. (io)

the semantics of a partial read/write of where errors happen is currently unclear and may change

Transforms this Read instance to an Iterator over chars. Read more

Creates an adaptor which will chain this stream with another. Read more

Creates an adaptor which will read at most limit bytes from it. Read more

impl AsyncRead for Context
[src]

Prepares an uninitialized buffer to be safe to pass to read. Returns true if the supplied buffer was zeroed out. Read more

Pull some bytes from this source into the specified Buf, returning how many bytes were read. Read more

Provides a Stream and Sink interface for reading and writing to this Io object, using Decode and Encode to read and write the raw data. Read more

Helper method for splitting this read/write object into two halves. Read more