logo
pub struct Module {
    pub name: String,
    pub root_path: String,
    pub static_folder: Option<String>,
    pub static_url_path: Option<String>,
    pub template_folder: Option<String>,
    /* private fields */
}
Expand description

Represents a module.

Fields

name: String

The name of the module.

root_path: String

The path where your module locates.

static_folder: Option<String>

The folder with static files that should be served at static_url_path.

static_url_path: Option<String>

The url path for the static files on the web.

template_folder: Option<String>

The folder that contains the templates that should be used for the module.

Implementations

The endpoint is automatically prefixed with the module’s name.

Before request for a module. This is only executed before each request that is handled by a view function of that module.

Before request for the app that this module is registered on. This is executed before each request, even if outside of a module.

After request for a module. This is only executed after each request that is handled by a view function of that module.

After request for the app that this module is registered on. This is executed after each request, even if outside of a module.

Teardown request for a module. This is only executed when tearing down each request that is handled by a view function of that module.

Teardown request for the app that this module is registered on. This is executed when tearing down each request, even if outside of a module.

Registers a http error handler that becomes active for this module only.

Registers an user error handler that becomes active for this module only.

Registers a http error handler for all requests of the application.

Registers an user error handler for all requests of the application.

Register this module.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Get the TypeId of this object.