Skip to main content

ServerTaskDone

Trait ServerTaskDone 

Source
pub trait ServerTaskDone<T, E>: Sized + 'static
where 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§

Source

fn _set_result(&mut self, res: Result<(), E>) -> RespNoti<T>

Should implement for enum delegation, not intended for user call

Provided Methods§

Source

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.

Implementors§

Source§

impl<T, M, E> ServerTaskDone<T, E> for ServerTaskVariant<T, M, E>
where T: Send + 'static, M: Send + 'static, E: RpcErrCodec,

Source§

impl<T, R, P, E> ServerTaskDone<T, E> for ServerTaskVariantFull<T, R, P, E>
where T: Send + 'static, R: Send + 'static, P: Send + 'static, E: RpcErrCodec,