[][src]Struct rocket_contrib::serve::Options

pub struct Options(_);

A bitset representing configurable options for the StaticFiles handler.

The valid options are:

Two Options structures can be ord together to slect two or more options. For instance, to request that both dot files and index pages be returned, use Options::DotFiles | Options::Index.

Methods

impl Options[src]

pub const None: Options[src]

Options representing the empty set. No dotfiles or index pages are rendered. This is different than the 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 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 Clone for Options[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Copy for Options[src]

impl BitOr<Options> for Options[src]

type Output = Self

The resulting type after applying the | operator.

impl Debug for Options[src]

Auto Trait Implementations

impl Send for Options

impl Sync for Options

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.

impl<T> IntoCollection for T

impl<T, I> AsResult for T where
    I: Input, 

impl<T> IntoSql for 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]

Convert &self to an expression for Diesel's query builder. Read more

impl<T> Same for T

type Output = T

Should always be Self

impl<T> Erased for T

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err