[][src]Struct actix_web::fs::StaticFiles

pub struct StaticFiles<S, C = DefaultConfig> { /* fields omitted */ }

Static files handling

StaticFile handler must be registered with App::handler() method, because StaticFile handler requires access sub-path information.

use actix_web::{fs, App};

fn main() {
    let app = App::new()
        .handler("/static", fs::StaticFiles::new(".").unwrap())
        .finish();
}

Methods

impl<S: 'static> StaticFiles<S>
[src]

Create new StaticFiles instance for specified base directory.

StaticFile uses CpuPool for blocking filesystem operations. By default pool with 20 threads is used. Pool size can be changed by setting ACTIX_CPU_POOL environment variable.

Create new StaticFiles instance for specified base directory and CpuPool.

impl<S: 'static, C: StaticFileConfig> StaticFiles<S, C>
[src]

Create new StaticFiles instance for specified base directory.

Identical with new but allows to specify configiration to use.

Create new StaticFiles instance for specified base directory with config and CpuPool.

Show files listing for directories.

By default show files listing is disabled.

Set custom directory renderer

Set index file

Redirects to specific index file for directory "/" instead of showing files listing.

Sets default handler which is used when no matched file could be found.

Trait Implementations

impl<S: 'static, C: 'static + StaticFileConfig> Handler<S> for StaticFiles<S, C>
[src]

The type of value that handler will return.

Handle request

Auto Trait Implementations

impl<S, C = DefaultConfig> !Send for StaticFiles<S, C>

impl<S, C = DefaultConfig> !Sync for StaticFiles<S, C>

Blanket Implementations

impl<T> From for T
[src]

Performs the conversion.

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

Performs the conversion.

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

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

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

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T