Struct http_serve::ChunkedReadFile[][src]

pub struct ChunkedReadFile<D: 'static + Send + Buf + From<Vec<u8>> + From<&'static [u8]>, E: 'static + Send + Into<Box<Error + Send + Sync>> + From<Box<Error>>> { /* fields omitted */ }

A HTTP entity created from a std::fs::File which reads the file chunk-by-chunk on a CpuPool.

Methods

impl<D, E> ChunkedReadFile<D, E> where
    D: 'static + Send + Buf + From<Vec<u8>> + From<&'static [u8]>,
    E: 'static + Send + Into<Box<Error + Send + Sync>> + From<Box<Error>>, 
[src]

Creates a new ChunkedReadFile.

read(2) calls will be performed on the supplied pool so that they don't block the tokio reactor thread on local disk I/O. Note that File::open and this constructor (specifically, its call to fstat(2)) may also block, so they typically shouldn't be called on the tokio reactor either.

Trait Implementations

impl<D: Clone + 'static + Send + Buf + From<Vec<u8>> + From<&'static [u8]>, E: Clone + 'static + Send + Into<Box<Error + Send + Sync>> + From<Box<Error>>> Clone for ChunkedReadFile<D, E>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<D, E> Entity for ChunkedReadFile<D, E> where
    D: 'static + Send + Buf + From<Vec<u8>> + From<&'static [u8]>,
    E: 'static + Send + Into<Box<Error + Send + Sync>> + From<Box<Error>>, 
[src]

The type of a data chunk. Read more

Returns the length of the entity's body in bytes.

Gets the body bytes indicated by range.

Adds entity headers such as Content-Type to the supplied Headers object. In particular, these headers are the "other representation header fields" described by RFC 7233 section 4.1; they should exclude Content-Range, Date, Cache-Control, ETag, Expires, Content-Location, and Vary. Read more

Returns an etag for this entity, if available. Implementations are encouraged to provide a strong etag. RFC 7232 section 2.1 notes that only strong etags are usable for sub-range retrieval. Read more

Returns the last modified time of this entity, if available. Note that serve may serve an earlier Last-Modified: date than the one returned here if this time is in the future, as required by RFC 7232 section 2.2.1. Read more

Returns true iff the entity's body has length 0.

Auto Trait Implementations

impl<D, E> Send for ChunkedReadFile<D, E>

impl<D, E> Sync for ChunkedReadFile<D, E> where
    D: Sync,
    E: Sync