[][src]Struct roa_core::App

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

Methods

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

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

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

pub fn handle_status<F>(
    &mut self,
    handler: impl 'static + Sync + Send + Fn(Context<M>, Status) -> F
) -> &mut Self 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>>
[src]

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

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

Trait Implementations

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

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> 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.