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

pub struct StaticFiles<S> { /* 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("."))
        .finish();
}

Methods

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

[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_FS_POOL environment variable.

[src]

Create new StaticFiles instance for specified base directory and CpuPool.

[src]

Show files listing for directories.

By default show files listing is disabled.

[src]

Set index file

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

[src]

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

Trait Implementations

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

The type of value that handler will return.

[src]

Handle request

Auto Trait Implementations

impl<S> !Send for StaticFiles<S>

impl<S> !Sync for StaticFiles<S>