Client

Struct Client 

Source
pub struct Client<C, CM, SM>
where C: Cancellable,
{ /* private fields */ }
Expand description

Receiving half of the peer’s connection.

Trait Implementations§

Source§

impl<C, CM, SM> Cancellable for Client<C, CM, SM>
where C: Debug + Send + Cancellable + 'static, <C as Cancellable>::Result: Send, <C as Cancellable>::Handle: Send + SenderHandle, Vec<u8>: From<<C as Cancellable>::Result>, CM: TryFrom<Vec<u8>> + Send, <CM as TryFrom<Vec<u8>>>::Error: Display, SM: Debug + Send,

Source§

type Result = CM

Type of values that can be yielded by the service.
Source§

type Handle = ClientHandle<C, SM>

Type of a handle for communicating with the service.
Source§

type Error = ClientError

Error returned by Self::run method.
Source§

fn new_handle<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Self::Handle> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Constructs a new handle for communicating with the service. Read more
Source§

fn run<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<CancellationResult<Self::Result>, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Performs a single unit of work. Read more
Source§

fn spawn<'async_trait>( self, cancellation_token: CancellationToken, ) -> Pin<Box<dyn Future<Output = CancellableHandle<Self>> + Send + 'async_trait>>
where Self: Sized + Send + 'static + 'async_trait,

Consumes the service and spawns its work loop. Read more
Source§

fn spawn_with_callback<'async_trait, F>( self, cancellation_token: CancellationToken, callback: F, ) -> Pin<Box<dyn Future<Output = CancellableHandle<Self>> + Send + 'async_trait>>
where Self: Sized + Send + 'static + 'async_trait, F: FnMut(Self::Result) -> Result<(), Self::Result> + Send + 'static + 'async_trait,

Consumes the service and spawns its work loop. Read more
Source§

impl<C, CM: Debug, SM: Debug> Debug for Client<C, CM, SM>
where C: Cancellable + Debug,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<C, CM, SM> Freeze for Client<C, CM, SM>
where <C as Cancellable>::Handle: Freeze,

§

impl<C, CM, SM> !RefUnwindSafe for Client<C, CM, SM>

§

impl<C, CM, SM> Send for Client<C, CM, SM>
where CM: Send, SM: Send, <C as Cancellable>::Handle: Send, <C as Cancellable>::Result: Send,

§

impl<C, CM, SM> Sync for Client<C, CM, SM>
where CM: Sync, SM: Sync, <C as Cancellable>::Handle: Sync, <C as Cancellable>::Result: Send,

§

impl<C, CM, SM> Unpin for Client<C, CM, SM>
where CM: Unpin, SM: Unpin,

§

impl<C, CM, SM> !UnwindSafe for Client<C, CM, SM>

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> Same for T

Source§

type Output = T

Should always be Self
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

Source§

impl<T> ErasedDestructor for T
where T: 'static,