[][src]Struct sapper::App

pub struct App {
    pub address: String,
    pub port: u32,
    pub armor: Option<Arc<Box<dyn SapperArmor + Send + Sync + 'static>>>,
    pub routers: Router,
    pub static_file_service: bool,
    pub init_closure: Option<Arc<Box<dyn Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>>>,
    pub not_found: Option<String>,
}

Sapper app struct

Fields

address: Stringport: u32armor: Option<Arc<Box<dyn SapperArmor + Send + Sync + 'static>>>routers: Routerstatic_file_service: boolinit_closure: Option<Arc<Box<dyn Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>>>not_found: Option<String>

Methods

impl SapperApp[src]

pub fn new() -> SapperApp[src]

pub fn address(&mut self, address: &str) -> &mut Self[src]

pub fn port(&mut self, port: u32) -> &mut Self[src]

pub fn static_file_service(&mut self, open: bool) -> &mut Self[src]

pub fn with_armor(
    &mut self,
    w: Box<dyn SapperArmor + Send + Sync + 'static>
) -> &mut Self
[src]

pub fn init_global(
    &mut self,
    clos: Box<dyn Fn(&mut SapperRequest) -> Result<()> + Send + Sync + 'static>
) -> &mut Self
[src]

pub fn not_found_page(&mut self, page: String) -> &mut Self[src]

pub fn add_module(&mut self, sm: Box<dyn SapperModule>) -> &mut Self[src]

pub fn run_http(self)[src]

Trait Implementations

impl Handler for SapperApp[src]

fn handle(&self, req: Request, res: Response)[src]

do actual handling for a request

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> Typeable for T where
    T: Any

impl<F> Handler for F where
    F: Fn(Request, Response<Fresh>) + Sync + Send
[src]

impl<T> UnsafeAny for T where
    T: Any