pub trait ServerTaskDone<T, E>: Sized + 'staticwhere
T: Send + 'static,
E: RpcErrCodec,{
// Required method
fn _set_result(&mut self, res: Result<(), E>) -> RespNoti<T>;
// Provided method
fn set_result(self, res: Result<(), E>)
where T: From<Self> { ... }
}Expand description
How to notify Rpc framework when a task is done
This is not mandatory for the framework, this a guideline, You can skip this as long as you send the result back to RespNoti.
Required Methods§
Sourcefn _set_result(&mut self, res: Result<(), E>) -> RespNoti<T>
fn _set_result(&mut self, res: Result<(), E>) -> RespNoti<T>
Should implement for enum delegation, not intended for user call
Provided Methods§
Sourcefn set_result(self, res: Result<(), E>)where
T: From<Self>,
fn set_result(self, res: Result<(), E>)where
T: From<Self>,
For users, set the result in the task and send it back
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.