pub trait HttpTrait:
Send
+ Sync
+ Any {
// Required method
fn operate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
req: &'life1 mut RecvRequest,
) -> Pin<Box<dyn Future<Output = ProtResult<RecvResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn middle_operate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
req: &'life1 mut RecvRequest,
middles: &'life2 mut Vec<Box<dyn Middleware>>,
) -> Pin<Box<dyn Future<Output = ProtResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn is_continue_next(&self) -> bool { ... }
fn as_any(&self) -> Option<&dyn Any> { ... }
fn as_any_mut(&mut self) -> Option<&mut dyn Any> { ... }
}
Required Methods§
Sourcefn operate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
req: &'life1 mut RecvRequest,
) -> Pin<Box<dyn Future<Output = ProtResult<RecvResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn operate<'life0, 'life1, 'async_trait>(
&'life0 mut self,
req: &'life1 mut RecvRequest,
) -> Pin<Box<dyn Future<Output = ProtResult<RecvResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
处理请求并返回正确的数据
Provided Methods§
Sourcefn middle_operate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
req: &'life1 mut RecvRequest,
middles: &'life2 mut Vec<Box<dyn Middleware>>,
) -> Pin<Box<dyn Future<Output = ProtResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn middle_operate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 mut self,
req: &'life1 mut RecvRequest,
middles: &'life2 mut Vec<Box<dyn Middleware>>,
) -> Pin<Box<dyn Future<Output = ProtResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
处理中间件的请求,跟中间件相关的处理
Sourcefn is_continue_next(&self) -> bool
fn is_continue_next(&self) -> bool
是否主动结束服务,返回false则表示服务暂停