Exchange

Struct Exchange 

Source
pub struct Exchange<Input, Output, Metadata> { /* private fields */ }

Implementations§

Source§

impl<Input, Output, Metadata> Exchange<Input, Output, Metadata>
where Input: Send + 'static, Output: Send + 'static, Metadata: Send,

Source

pub fn new() -> Self

Source

pub fn add_metadata(&mut self, metadata: Metadata)

Source

pub fn attachments(&self) -> &Attachments

Source

pub fn attachments_mut(&mut self) -> &mut Attachments

Source

pub fn add_input_listener( &mut self, callback: impl FnMut(&mut Input, &mut Attachments) + Send + 'static, )

Source

pub fn add_output_listener( &mut self, callback: impl FnMut(&mut Output, &mut Attachments) + Send + 'static, )

Source

pub fn save_input(&mut self, request: Input)

Source

pub fn input(&self) -> Result<&Input, ExchangeError>

Source

pub fn input_mut(&mut self) -> Result<&mut Input, ExchangeError>

Source

pub fn take_request(&mut self) -> Result<Input, ExchangeError>

Source

pub fn save_output(&mut self, response: Output)

Source

pub fn output(&self) -> Result<&Output, ExchangeError>

Source

pub fn output_mut(&mut self) -> Result<&mut Output, ExchangeError>

Source

pub fn take_output(&mut self) -> Result<Output, ExchangeError>

Auto Trait Implementations§

§

impl<Input, Output, Metadata> Freeze for Exchange<Input, Output, Metadata>
where Metadata: Freeze, Input: Freeze, Output: Freeze,

§

impl<Input, Output, Metadata> !RefUnwindSafe for Exchange<Input, Output, Metadata>

§

impl<Input, Output, Metadata> Send for Exchange<Input, Output, Metadata>
where Metadata: Send, Input: Send, Output: Send,

§

impl<Input, Output, Metadata> !Sync for Exchange<Input, Output, Metadata>

§

impl<Input, Output, Metadata> Unpin for Exchange<Input, Output, Metadata>
where Metadata: Unpin, Input: Unpin, Output: Unpin,

§

impl<Input, Output, Metadata> !UnwindSafe for Exchange<Input, Output, Metadata>

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.