[−][src]Struct http_fs::StaticFiles
Static files service
Methods
impl<C: StaticFileConfig> StaticFiles<C>
[src]
pub fn new(config: C) -> Self
[src]
Creates new instance with provided config
pub fn workers(&self) -> &ThreadPool
[src]
Returns reference to thread pool
pub fn serve(&self, path: &Path) -> ServeEntry
[src]
Serves file
pub fn handle_not_found(
&self,
path: &Path,
out_headers: &mut HeaderMap
) -> (StatusCode, Bytes)
[src]
&self,
path: &Path,
out_headers: &mut HeaderMap
) -> (StatusCode, Bytes)
Handles not found directory
pub fn list_dir(&self, path: &Path, dir: ReadDir) -> Bytes
[src]
Serve directory routine
pub fn serve_file(
&self,
path: &Path,
file: File,
meta: Metadata,
method: Method,
headers: &HeaderMap,
out_headers: &mut HeaderMap
) -> (StatusCode, Option<ChunkedReadFile<C::FileService>>)
[src]
&self,
path: &Path,
file: File,
meta: Metadata,
method: Method,
headers: &HeaderMap,
out_headers: &mut HeaderMap
) -> (StatusCode, Option<ChunkedReadFile<C::FileService>>)
Serves file routine
Trait Implementations
impl<C: Clone> Clone for StaticFiles<C>
[src]
fn clone(&self) -> StaticFiles<C>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for StaticFiles<DefaultConfig>
[src]
impl<C: StaticFileConfig> Service for StaticFiles<C>
[src]
type ReqBody = Body
The Payload
body of the http::Request
.
type ResBody = Body
The Payload
body of the http::Response
.
type Error = Error
The error type that can occur within this Service
. Read more
type Future = FutureResult<Response<Self::ResBody>, Self::Error>
The Future
returned by this Service
.
fn call(&mut self, req: Request<Self::ReqBody>) -> Self::Future
[src]
fn poll_ready(&mut self) -> Result<Async<()>, Self::Error>
[src]
Returns Ready
when the service is able to process requests. Read more
impl<C: StaticFileConfig + Clone, Ctx> MakeService<Ctx> for StaticFiles<C>
[src]
type ReqBody = Body
The Payload
body of the http::Request
.
type ResBody = Body
The Payload
body of the http::Response
.
type Error = Error
The error type that can be returned by Service
s.
type Service = Self
The resolved Service
from new_service()
.
type MakeError = Error
The error type that can be returned when creating a new Service
.
type Future = FutureResult<Self::Service, Self::MakeError>
The future returned from new_service
of a Service
.
fn make_service(&mut self, _: Ctx) -> Self::Future
[src]
fn poll_ready(&mut self) -> Result<Async<()>, Self::MakeError>
[src]
Returns Ready
when the constructor is ready to create a new Service
. Read more
Auto Trait Implementations
impl<C> Unpin for StaticFiles<C> where
C: Unpin,
C: Unpin,
impl<C = DefaultConfig> !Sync for StaticFiles<C>
impl<C> Send for StaticFiles<C> where
C: Send,
C: Send,
impl<C = DefaultConfig> !UnwindSafe for StaticFiles<C>
impl<C = DefaultConfig> !RefUnwindSafe for StaticFiles<C>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<N, Ctx> MakeService<Ctx> for N where
N: NewService,
[src]
N: NewService,
type ReqBody = <N as NewService>::ReqBody
The Payload
body of the http::Request
.
type ResBody = <N as NewService>::ResBody
The Payload
body of the http::Response
.
type Error = <N as NewService>::Error
The error type that can be returned by Service
s.
type Service = <N as NewService>::Service
The resolved Service
from new_service()
.
type Future = <N as NewService>::Future
The future returned from new_service
of a Service
.
type MakeError = <N as NewService>::InitError
The error type that can be returned when creating a new Service
.
fn poll_ready(
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
[src]
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>