Skip to main content

ServerTaskVariantFull

Struct ServerTaskVariantFull 

Source
pub struct ServerTaskVariantFull<T, R, P, E>
where T: Send + 'static, R: Send + 'static, P: Send + 'static, E: RpcErrCodec,
{ pub seq: u64, pub action: RpcActionOwned, pub req: R, pub req_blob: Option<Buffer>, pub resp: Option<P>, pub resp_blob: Option<Buffer>, pub res: Option<Result<(), E>>, /* private fields */ }
Expand description

A container that impl ServerTaskResp to show an example, presuming you have a type to carry both Request and Response. You can write your customize version.

Fields§

§seq: u64§action: RpcActionOwned§req: R§req_blob: Option<Buffer>§resp: Option<P>§resp_blob: Option<Buffer>§res: Option<Result<(), E>>

Trait Implementations§

Source§

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

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

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

Source§

fn get_action<'a>(&'a self) -> RpcAction<'a>

Source§

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

Source§

fn decode_req<'a, C: Codec>( codec: &'a C, action: RpcAction<'a>, seq: u64, msg: &'a [u8], blob: Option<Buffer>, noti: RespNoti<T>, ) -> Result<Self, ()>

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,

Source§

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

Should implement for enum delegation, not intended for user call
Source§

fn set_result(self, res: Result<(), E>)
where T: From<Self>,

For users, set the result in the task and send it back
Source§

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

Source§

fn encode_resp<'a, 'b, C: Codec>( &'a mut self, codec: &'b C, buf: &'b mut Vec<u8>, ) -> (u64, Result<(usize, Option<&'a [u8]>), EncodedErr>)

Auto Trait Implementations§

§

impl<T, R, P, E> !Freeze for ServerTaskVariantFull<T, R, P, E>

§

impl<T, R, P, E> !RefUnwindSafe for ServerTaskVariantFull<T, R, P, E>

§

impl<T, R, P, E> Send for ServerTaskVariantFull<T, R, P, E>

§

impl<T, R, P, E> Sync for ServerTaskVariantFull<T, R, P, E>
where R: Sync, P: Sync, E: Sync,

§

impl<T, R, P, E> Unpin for ServerTaskVariantFull<T, R, P, E>
where R: Unpin, P: Unpin,

§

impl<T, R, P, E> !UnwindSafe for ServerTaskVariantFull<T, R, P, E>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V