Skip to main content

Area

Trait Area 

Source
pub trait Area:
    Send
    + Sync
    + 'static {
    type Principal: AreaPrincipal;

    const NAME: &'static str;
    const PREFIX: &'static str;
    const SIGN_IN: &'static str;
    const TOKENS: bool = false;
    const CLIENT: Client = Client::Html;
}
Expand description

Its principal resolves only in its own area.

Required Associated Constants§

Source

const NAME: &'static str

The folder under a module’s src/areas/, such as web.

Source

const PREFIX: &'static str

Source

const SIGN_IN: &'static str

Provided Associated Constants§

Source

const TOKENS: bool = false

Accepts Authorization: Bearer beside the session cookie.

Source

const CLIENT: Client = Client::Html

Read by sofie gen and the build script, which compile the area’s screens for it.

Required Associated Types§

Source

type Principal: AreaPrincipal

Fixes the area’s access, so the two cannot disagree.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Area for Web

Source§

const NAME: &'static str = "web"

Source§

const PREFIX: &'static str = ""

Source§

const SIGN_IN: &'static str = "/"

Source§

type Principal = Visitor