Struct dyer::engine::engine::App[][src]

pub struct App<E> {
Show 13 fields pub task: Vault<VecDeque<Task>>, pub task_tmp: Vault<Vec<Task>>, pub affix: Vault<VecDeque<Affix>>, pub req: Vault<VecDeque<Request>>, pub req_tmp: Vault<Vec<Request>>, pub res: Vault<Vec<Result<Response, MetaResponse>>>, pub entities: Vault<Vec<E>>, pub errs: Vault<Vec<Result<Response, MetaResponse>>>, pub args: ArgApp, pub couple: Vault<HashMap<u64, Couple>>, pub session_storer: Option<Box<dyn for<'a> Fn(Poly, &'a ()) -> &'a str + Send>>, pub session_loader: Option<Box<dyn Fn(&str) -> Poly + Send>>, pub body_modifier: Option<Box<dyn for<'c, 'd> Fn(&'c Body, Option<&'d Body>) -> Body + Send>>, // some fields omitted
}
Expand description

An abstraction and collection of data flow

Fields

task: Vault<VecDeque<Task>>

a vector of Task, store them into directory if too many in order to lower the memory

task_tmp: Vault<Vec<Task>>

cached Taskto be used

affix: Vault<VecDeque<Affix>>

a vector of Affix

req: Vault<VecDeque<Request>>

a vector of Request

req_tmp: Vault<Vec<Request>>

cached Requestto be spawned

res: Vault<Vec<Result<Response, MetaResponse>>>

a vector of Response

entities: Vault<Vec<E>>

collected entities

errs: Vault<Vec<Result<Response, MetaResponse>>>

some parse-failed Response for manual inspection

args: ArgApp

Some argument to control the data flow

couple: Vault<HashMap<u64, Couple>>

couples of task and affix, serving as a backup when the constructed request executed failed

session_storer: Option<Box<dyn for<'a> Fn(Poly, &'a ()) -> &'a str + Send>>

periodically called to backup Poly NOTE that if None all Poly lost at runtime when interupts happens

session_loader: Option<Box<dyn Fn(&str) -> Poly + Send>>

called to load Poly at resuming session or load Task to execute NOTE that if None App Starts with new session

body_modifier: Option<Box<dyn for<'c, 'd> Fn(&'c Body, Option<&'d Body>) -> Body + Send>>

modify the body of Task, Affix in Couple return the Request’s Body if not set, just simply concat the two of them

Implementations

create an instance of App

add an Actor

add an Session Loader

add an Session Storer

modify the body of Task, Affix in Couple return the Request’s Body if not set, just simply concat the two of them get the overview of App

specifically, dispose a Response, handle failed or corrupt Response, and return Parsed or ParseError.

parse multiple Response in App, then drive all Parsed into MiddleWare

drive Dyer into running.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more