pub struct Whole<Op: Operation> { /* private fields */ }Expand description
The fold of an operation whose reply is one whole answer: it has no events, and the provider’s end is the response. The stamp writes what the driver learned about the reply onto it.
use std::convert::Infallible;
use rig_core::operation::Whole;
use rig_core::wire::{Call, Free, Operation};
struct Echo;
impl Operation for Echo {
type Request = String;
type Event = Infallible;
type End = String;
type Response = String;
type Fold = Whole<Self>;
type Emit = Free;
fn fold(_request: &String, _call: &mut Call<'_>) -> Whole<Self> {
Whole::<Self>::stamping(|response, reply| response.push_str(&reply.provider))
}
}Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<Op> Freeze for Whole<Op>
impl<Op> RefUnwindSafe for Whole<Op>
impl<Op> Send for Whole<Op>
impl<Op> Sync for Whole<Op>
impl<Op> Unpin for Whole<Op>
impl<Op> UnsafeUnpin for Whole<Op>
impl<Op> UnwindSafe for Whole<Op>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more