Struct rocket_contrib::serve::Options [−][src]
pub struct Options(_);
Expand description
A bitset representing configurable options for the StaticFiles
handler.
The valid options are:
Options::None
- Return only present, visible files.Options::DotFiles
- In addition to visible files, return dotfiles.Options::Index
- Renderindex.html
pages for directory requests.Options::NormalizeDirs
- Redirect directories without a trailing slash to ones with a trailing slash.
Options
structures can be or
d together to select two or more options.
For instance, to request that both dot files and index pages be returned,
use Options::DotFiles | Options::Index
.
Implementations
impl Options
[src]
impl Options
[src]pub const None: Options
[src]
pub const None: Options
[src]Options
representing the empty set. No dotfiles or index pages are
rendered. This is different than Options::default()
,
which enables Index
.
pub const Index: Options
[src]
pub const Index: Options
[src]Options
enabling responding to requests for a directory with the
index.html
file in that directory, if it exists. When this is enabled,
the StaticFiles
handler will respond to requests for a directory
/foo
with the file ${root}/foo/index.html
if it exists. This is
enabled by default.
pub const DotFiles: Options
[src]
pub const DotFiles: Options
[src]Options
enabling returning dot files. When this is enabled, the
StaticFiles
handler will respond to requests for files or
directories beginning with .
. This is not enabled by default.
pub const NormalizeDirs: Options
[src]
pub const NormalizeDirs: Options
[src]Options
that normalizes directory requests by redirecting requests to
directory paths without a trailing slash to ones with a trailing slash.
When enabled, the StaticFiles
handler will respond to requests for a
directory without a trailing /
with a permanent redirect (308) to the
same path with a trailing /
. This ensures relative URLs within any
document served for that directory will be interpreted relative to that
directory, rather than its parent. This is not enabled by default.
pub fn contains(self, other: Options) -> bool
[src]
pub fn contains(self, other: Options) -> bool
[src]Returns true
if self
is a superset of other
. In other words,
returns true
if all of the options in other
are also in self
.
Example
use rocket_contrib::serve::Options; let index_request = Options::Index | Options::DotFiles; assert!(index_request.contains(Options::Index)); assert!(index_request.contains(Options::DotFiles)); let index_only = Options::Index; assert!(index_only.contains(Options::Index)); assert!(!index_only.contains(Options::DotFiles)); let dot_only = Options::DotFiles; assert!(dot_only.contains(Options::DotFiles)); assert!(!dot_only.contains(Options::Index));
Trait Implementations
impl Copy for Options
[src]
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
Converts self
into a collection.
pub fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<T> IntoSql for T
[src]
impl<T> IntoSql for T
[src]fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
[src]Convert self
to an expression for Diesel’s query builder. Read more
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
[src]Convert &self
to an expression for Diesel’s query builder. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,