Struct rocket_static_fs::StaticFileServer [−][src]
pub struct StaticFileServer<T> where
T: FileSystem + Sized + Send + Sync, { /* fields omitted */ }
StaticFileServer is your fairing for the static file server.
Methods
impl<T> StaticFileServer<T> where
T: FileSystem + Sized + Send + Sync,
[src]
impl<T> StaticFileServer<T> where
T: FileSystem + Sized + Send + Sync,
pub fn new(fs: T, options: Options) -> Result<Self, Box<StdError>>
[src]
pub fn new(fs: T, options: Options) -> Result<Self, Box<StdError>>
Constructs a new StaticFileServer fairing.
path
is local directory to serve from.
prefix
is the prefix the serve from.
You can set a prefix of /assets and only requests to /assets/* will be served.
Trait Implementations
impl<T: 'static> Fairing for StaticFileServer<T> where
T: FileSystem + Sized + Send + Sync,
[src]
impl<T: 'static> Fairing for StaticFileServer<T> where
T: FileSystem + Sized + Send + Sync,
fn info(&self) -> Info
[src]
fn info(&self) -> Info
Returns an Info
structure containing the name
and Kind
of this fairing. The name
can be any arbitrary string. Kind
must be an or
d set of Kind
variants. Read more
fn on_response(&self, request: &Request, response: &mut Response)
[src]
fn on_response(&self, request: &Request, response: &mut Response)
The response callback. Read more
fn on_attach(&self, rocket: Rocket) -> Result<Rocket, Rocket>
[src]
fn on_attach(&self, rocket: Rocket) -> Result<Rocket, Rocket>
The attach callback. Returns Ok
if launch should proceed and Err
if launch should be aborted. Read more
fn on_launch(&self, rocket: &Rocket)
[src]
fn on_launch(&self, rocket: &Rocket)
The launch callback. Read more
fn on_request(&self, request: &mut Request, data: &Data)
[src]
fn on_request(&self, request: &mut Request, data: &Data)
The request callback. Read more
Auto Trait Implementations
impl<T> Send for StaticFileServer<T>
impl<T> Send for StaticFileServer<T>
impl<T> Sync for StaticFileServer<T>
impl<T> Sync for StaticFileServer<T>