Trait dyer::plugin::Affixor [−][src]
pub trait Affixor {
fn init<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn invoke<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<Request>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn after_invoke<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn before_parse<'life0, 'life1, 'async_trait>(
&'life0 mut self,
__arg1: Option<&'life1 mut Result<Response, MetaResponse>>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn parse<'life0, 'async_trait>(
&'life0 mut self,
__arg1: Option<Result<Response, MetaResponse>>
) -> Pin<Box<dyn Future<Output = Option<Affix>> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn after_parse<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
fn close<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Trait to adjust Task before make a request
Required methods
Things to do before step into generating Affix
Invoke an Request to generating affix
if None is returned, this means affix generating does not depend on
Request-Response. Then no Response or MetaResponse for before_parse
and parse
Before executing the Request, modify the Request
Before parsing affix, modify the response
Parse the response into Affix
It is called only when parse is called Before collecting the parsed affix, modify the affix