[][src]Struct roa_core::App

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

Methods

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

pub fn new(handler: Arc<DynHandler<M>>, model: Arc<M>) -> Self[src]

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

pub fn handle_status_fn<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 async fn serve<'_>(
    &'_ self,
    req: Request,
    peer_addr: SocketAddr
) -> Result<Response, Status>
[src]

pub fn listen(&self, addr: SocketAddr) -> Server<AddrIncoming, App<M>>[src]

Trait Implementations

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

impl<'_, M: Model> Service<&'_ AddrStream> for App<M>[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>> + Send + 'static>>

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