Struct dyer::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 Task
to be used
affix: Vault<VecDeque<Affix>>
a vector of Affix
req: Vault<VecDeque<Request>>
a vector of Request
req_tmp: Vault<Vec<Request>>
cached Request
to 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
add an Actor
add an Session Loader
add an Session Storer
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
Auto Trait Implementations
impl<E> !RefUnwindSafe for App<E>
impl<E> !UnwindSafe for App<E>
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
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