Skip to main content

Module task

Module task 

Source
Expand description

Trait and utils for client-side task

Provided Macros

  • #[client_task]: For defining a client-side RPC task on a struct. It will not generate ClientTask trait (it’s optional to you to define ClientTaskAction with it)
  • #[client_task_enum]: For creating an enum that delegates to client task variants. It will generate ClientTask trait for the enum

Structs§

ClientTaskCommon
A common struct for every ClientTask

Traits§

ClientTask
Sum up trait for client task, including request and response
ClientTaskAction
Get RpcAction from a enum task, or a sub-type that fits multiple RpcActions
ClientTaskDecode
Decode the response from server and assign to the task struct
ClientTaskDone
How to notify from Rpc framework to user when a task is done
ClientTaskEncode
Encode the request to buffer that can be send to server
ClientTaskGetResult
client_task_enum should impl this for user, not used by framework

Attribute Macros§

client_task
#[client_task]
client_task_enum
#[client_task_enum]