[−][src]Struct rocket_contrib::serve::Options
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]
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]
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]
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]
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]
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 BitOr<Options> for Options
[src]
type Output = Self
The resulting type after applying the |
operator.
fn bitor(self, rhs: Self) -> Self
[src]
impl Clone for Options
[src]
impl Copy for Options
[src]
impl Debug for Options
[src]
impl Default for Options
[src]
The default set of options: Options::Index
.
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
pub fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> IntoSql for T
fn into_sql<T>(self) -> Self::Expression where
Self: AsExpression<T>,
Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression where
&'a Self: AsExpression<T>,
&'a Self: AsExpression<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut 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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,