pub struct ClientDispatcher<P, T = Channel>where
T: Transport,{ /* private fields */ }
Expand description
A strongly typed client dispatcher.
Implementations§
Source§impl<P, T> ClientDispatcher<P, T>where
T: Transport,
impl<P, T> ClientDispatcher<P, T>where
T: Transport,
Sourcepub fn new(client_end: ClientEnd<P, T>) -> ClientDispatcher<P, T>
pub fn new(client_end: ClientEnd<P, T>) -> ClientDispatcher<P, T>
Creates a new client from a client end.
Sourcepub fn from_untyped(dispatcher: ClientDispatcher<T>) -> ClientDispatcher<P, T>
pub fn from_untyped(dispatcher: ClientDispatcher<T>) -> ClientDispatcher<P, T>
Creates a new client from an untyped client.
Sourcepub async fn run<H>(
self,
handler: H,
) -> Result<H, ProtocolError<<T as Transport>::Error>>where
P: DispatchClientMessage<H, T>,
pub async fn run<H>(
self,
handler: H,
) -> Result<H, ProtocolError<<T as Transport>::Error>>where
P: DispatchClientMessage<H, T>,
Runs the client with the provided handler.
Sourcepub async fn run_client(
self,
) -> Result<(), ProtocolError<<T as Transport>::Error>>
pub async fn run_client( self, ) -> Result<(), ProtocolError<<T as Transport>::Error>>
Runs the client, ignoring any incoming events.
Trait Implementations§
Source§impl<T, P> CompatFrom<T> for ClientDispatcher<P>where
P: ClientCompatFrom<T>,
impl<T, P> CompatFrom<T> for ClientDispatcher<P>where
P: ClientCompatFrom<T>,
Source§fn compat_from(value: T) -> ClientDispatcher<P>
fn compat_from(value: T) -> ClientDispatcher<P>
Converts
value
into a value of this type.impl<P, T> Send for ClientDispatcher<P, T>
Auto Trait Implementations§
impl<P, T> Freeze for ClientDispatcher<P, T>
impl<P, T = Channel> !RefUnwindSafe for ClientDispatcher<P, T>
impl<P, T> Sync for ClientDispatcher<P, T>
impl<P, T> Unpin for ClientDispatcher<P, T>
impl<P, T = Channel> !UnwindSafe for ClientDispatcher<P, T>
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<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T
to Self