[][src]Struct roa::App

pub struct App<M> where
    M: Model
{ /* fields omitted */ }

Methods

impl<M> App<M> where
    M: Model
[src]

pub fn new(model: M) -> App<M>[src]

pub fn gate<F>(
    &mut self,
    middleware: impl Send + Sync + Fn(Context<M>, Box<dyn FnOnce() + 'static + Sync + Send>) -> F + 'static
) -> &mut App<M> where
    F: 'static + Future<Output = Result<(), Status>> + Send
[src]

pub fn handle_status<F>(
    &mut self,
    handler: impl Send + Sync + Fn(Context<M>, Status) -> F + 'static
) -> &mut App<M> where
    F: 'static + Future<Output = Result<(), Status>> + Send
[src]

pub fn listen(
    &self,
    addr: impl ToSocketAddrs,
    callback: impl Fn(SocketAddr)
) -> Result<Server<AddrIncoming, App<M>, Executor>, Error>
[src]

pub fn run(
    &self
) -> Result<(SocketAddr, Server<AddrIncoming, App<M>, Executor>), Error>
[src]

pub fn run_local(
    &self
) -> Result<(SocketAddr, Server<AddrIncoming, App<M>, Executor>), Error>
[src]

Trait Implementations

impl<M> Clone for App<M> where
    M: Model
[src]

impl<'_, M> Service<&'_ AddrStream> for App<M> where
    M: Model
[src]

type Response = HttpService<M>

Responses given by the service.

type Error = Error

Errors produced by the service.

type Future = Pin<Box<dyn Future<Output = Result<HttpService<M>, Error>> + 'static + Send>>

The future response value.

Auto Trait Implementations

impl<M> !RefUnwindSafe for App<M>

impl<M> Send for App<M>

impl<M> Sync for App<M>

impl<M> Unpin for App<M>

impl<M> !UnwindSafe for App<M>

Blanket Implementations

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

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

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

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

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

impl<T> State for T where
    T: 'static + Send + Sync
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.