Returning

Trait Returning 

Source
pub trait Returning:
    Send
    + Sync
    + Sealed {
    // Required method
    fn returning(
        &self,
        req: Request<String>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>;
}
Expand description

Trait for responses matching mock cases

Required Methods§

Source

fn returning( &self, req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Return a Response based on the incoming Request

Implementations on Foreign Types§

Source§

impl Returning for Value

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Source§

impl Returning for u16

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Source§

impl Returning for String

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Source§

impl Returning for StatusCode

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Source§

impl<'a> Returning for &'a str

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Source§

impl<'a> Returning for Cow<'a, str>

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Source§

impl<S, B> Returning for (S, B)
where (S, B): Send + Sync, S: TryInto<StatusCode> + Clone, S::Error: StdError + Send + Sync + 'static, B: ToString + 'static,

Source§

fn returning( &self, _req: Request<String>, ) -> Pin<Box<dyn Future<Output = Result<Response<String>, Box<dyn StdError + Send + Sync>>> + Send + Sync + 'static>>

Implementors§

Source§

impl<F, R> Returning for F
where F: Fn(Request<String>) -> R + Send + Sync, R: IntoResponseFuture,