pub struct ClientEnd<P, T = Channel> { /* private fields */ }
Expand description
The client end of a protocol.
Implementations§
Source§impl<P, T> ClientEnd<P, T>
impl<P, T> ClientEnd<P, T>
Sourcepub fn from_untyped(transport: T) -> Self
pub fn from_untyped(transport: T) -> Self
Returns a new endpoint over the given transport.
Sourcepub fn into_untyped(self) -> T
pub fn into_untyped(self) -> T
Returns the underlying transport.
Sourcepub fn executor(&self) -> T::Executorwhere
T: HasExecutor,
pub fn executor(&self) -> T::Executorwhere
T: HasExecutor,
Returns the executor for the underlying transport.
Source§impl<P, T: Transport> ClientEnd<P, T>
impl<P, T: Transport> ClientEnd<P, T>
Sourcepub fn spawn_full_with_handler_on<H, E>(
self,
handler: H,
executor: &E,
) -> (ClientSender<P, T>, HandlerTask<T, H, E>)
pub fn spawn_full_with_handler_on<H, E>( self, handler: H, executor: &E, ) -> (ClientSender<P, T>, HandlerTask<T, H, E>)
Spawns a client for the given client end with a handler on an executor.
Returns the client sender and a join handle for the spawned task.
Sourcepub fn spawn_with_handler_on<H, E>(
self,
handler: H,
executor: &E,
) -> ClientSender<P, T>
pub fn spawn_with_handler_on<H, E>( self, handler: H, executor: &E, ) -> ClientSender<P, T>
Spawns a client for the given client end with a handler on an executor.
Returns the client sender.
Sourcepub fn spawn_full_with_handler<H>(
self,
handler: H,
) -> (ClientSender<P, T>, HandlerTask<T, H>)
pub fn spawn_full_with_handler<H>( self, handler: H, ) -> (ClientSender<P, T>, HandlerTask<T, H>)
Spawns a client for the given client end with a handler on the default executor for the transport.
Returns the client sender and a join handle for the spawned task.
Sourcepub fn spawn_with_handler<H>(self, handler: H) -> ClientSender<P, T>
pub fn spawn_with_handler<H>(self, handler: H) -> ClientSender<P, T>
Spawns a client for the given client end with a handler on the default executor for the transport.
Returns the client sender.
Sourcepub fn spawn_full_on<E>(
self,
executor: &E,
) -> (ClientSender<P, T>, HandlerTask<T, (), E>)where
P: 'static,
T: 'static,
E: Executor,
pub fn spawn_full_on<E>(
self,
executor: &E,
) -> (ClientSender<P, T>, HandlerTask<T, (), E>)where
P: 'static,
T: 'static,
E: Executor,
Spawns a client for the given client end on an executor.
The spawned client will ignore all incoming events. Returns the client sender and a join handle for the spawned task.
Sourcepub fn spawn_on<E>(self, executor: &E) -> ClientSender<P, T>where
P: 'static,
T: 'static,
E: Executor,
pub fn spawn_on<E>(self, executor: &E) -> ClientSender<P, T>where
P: 'static,
T: 'static,
E: Executor,
Spawns a client for the given client end on an executor.
The spawned client will ignore all incoming events. Returns the client sender.
Sourcepub fn spawn_full(self) -> (ClientSender<P, T>, HandlerTask<T, ()>)where
P: 'static,
T: HasExecutor + 'static,
pub fn spawn_full(self) -> (ClientSender<P, T>, HandlerTask<T, ()>)where
P: 'static,
T: HasExecutor + 'static,
Spawns a client for the given client end on the default executor for the transport.
The spawned client will ignore all incoming events. Returns the client sender and a join handle for the spawned task.
Sourcepub fn spawn(self) -> ClientSender<P, T>where
P: 'static,
T: HasExecutor + 'static,
pub fn spawn(self) -> ClientSender<P, T>where
P: 'static,
T: HasExecutor + 'static,
Spawns a client for the given client end on the default executor for the transport.
The spawned client will ignore all incoming events. Returns the client sender.
Trait Implementations§
Source§impl<P1, P2, T> CompatFrom<ClientEnd<P1>> for ClientEnd<P2, T>where
T: CompatFrom<Channel>,
P2: CompatFrom<P1>,
impl<P1, P2, T> CompatFrom<ClientEnd<P1>> for ClientEnd<P2, T>where
T: CompatFrom<Channel>,
P2: CompatFrom<P1>,
Source§fn compat_from(value: ClientEnd<P1>) -> Self
fn compat_from(value: ClientEnd<P1>) -> Self
value
into a value of this type.Source§impl<P1, P2, T> CompatFrom<ClientEnd<P1, T>> for ClientEnd<P2>where
Channel: CompatFrom<T>,
P2: CompatFrom<P1>,
impl<P1, P2, T> CompatFrom<ClientEnd<P1, T>> for ClientEnd<P2>where
Channel: CompatFrom<T>,
P2: CompatFrom<P1>,
Source§fn compat_from(value: ClientEnd<P1, T>) -> Self
fn compat_from(value: ClientEnd<P1, T>) -> Self
value
into a value of this type.Source§impl<P, T> EncodableOption for ClientEnd<P, T>where
T: EncodableOption,
P: 'static,
impl<P, T> EncodableOption for ClientEnd<P, T>where
T: EncodableOption,
P: 'static,
Source§type EncodedOption = ClientEnd<P, <T as EncodableOption>::EncodedOption>
type EncodedOption = ClientEnd<P, <T as EncodableOption>::EncodedOption>
Source§impl<E, P, T> EncodeOption<E> for ClientEnd<P, T>where
E: ?Sized,
P: 'static,
T: EncodeOption<E>,
impl<E, P, T> EncodeOption<E> for ClientEnd<P, T>where
E: ?Sized,
P: 'static,
T: EncodeOption<E>,
Source§fn encode_option(
this: Option<Self>,
encoder: &mut E,
out: &mut MaybeUninit<Self::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>
Source§impl<E, P, T> EncodeOptionRef<E> for ClientEnd<P, T>where
E: ?Sized,
P: 'static,
T: EncodeOptionRef<E>,
impl<E, P, T> EncodeOptionRef<E> for ClientEnd<P, T>where
E: ?Sized,
P: 'static,
T: EncodeOptionRef<E>,
Source§fn encode_option_ref(
this: Option<&Self>,
encoder: &mut E,
out: &mut MaybeUninit<Self::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option_ref( this: Option<&Self>, encoder: &mut E, out: &mut MaybeUninit<Self::EncodedOption>, ) -> Result<(), EncodeError>
Source§impl<E, P, T> EncodeRef<E> for ClientEnd<P, T>where
E: ?Sized,
P: 'static,
T: EncodeRef<E>,
impl<E, P, T> EncodeRef<E> for ClientEnd<P, T>where
E: ?Sized,
P: 'static,
T: EncodeRef<E>,
Source§fn encode_ref(
&self,
encoder: &mut E,
out: &mut MaybeUninit<Self::Encoded>,
) -> Result<(), EncodeError>
fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<Self::Encoded>, ) -> Result<(), EncodeError>
Source§impl<P, T, U> FromWireOption<ClientEnd<P, U>> for ClientEnd<P, T>where
P: 'static,
T: FromWireOption<U>,
U: Wire,
impl<P, T, U> FromWireOption<ClientEnd<P, U>> for ClientEnd<P, T>where
P: 'static,
T: FromWireOption<U>,
U: Wire,
Source§fn from_wire_option(wire: ClientEnd<P, U>) -> Option<Self>
fn from_wire_option(wire: ClientEnd<P, U>) -> Option<Self>
wire
to an option of this type.Source§impl<P, T, U> FromWireOptionRef<ClientEnd<P, U>> for ClientEnd<P, T>where
P: 'static,
T: FromWireOptionRef<U>,
U: Wire,
impl<P, T, U> FromWireOptionRef<ClientEnd<P, U>> for ClientEnd<P, T>where
P: 'static,
T: FromWireOptionRef<U>,
U: Wire,
Source§fn from_wire_option_ref(wire: &ClientEnd<P, U>) -> Option<Self>
fn from_wire_option_ref(wire: &ClientEnd<P, U>) -> Option<Self>
wire
reference to an option of this type.Source§impl<P, T, U> FromWireRef<ClientEnd<P, U>> for ClientEnd<P, T>where
T: FromWireRef<U>,
impl<P, T, U> FromWireRef<ClientEnd<P, U>> for ClientEnd<P, T>where
T: FromWireRef<U>,
Source§fn from_wire_ref(wire: &ClientEnd<P, U>) -> Self
fn from_wire_ref(wire: &ClientEnd<P, U>) -> Self
wire
reference to this type.Source§impl<P: 'static, T: Wire> Wire for ClientEnd<P, T>
impl<P: 'static, T: Wire> Wire for ClientEnd<P, T>
Source§type Decoded<'de> = ClientEnd<P, <T as Wire>::Decoded<'de>>
type Decoded<'de> = ClientEnd<P, <T as Wire>::Decoded<'de>>
'de
lifetime.Source§fn zero_padding(out: &mut MaybeUninit<Self>)
fn zero_padding(out: &mut MaybeUninit<Self>)
impl<P, T: Send> Send for ClientEnd<P, T>
impl<P, T: Sync> Sync for ClientEnd<P, T>
Auto Trait Implementations§
impl<P, T> Freeze for ClientEnd<P, T>where
T: Freeze,
impl<P, T> RefUnwindSafe for ClientEnd<P, T>where
T: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, T> Unpin for ClientEnd<P, T>
impl<P, T> UnwindSafe for ClientEnd<P, T>where
T: UnwindSafe,
P: UnwindSafe,
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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
T: FromWire<W>,
§fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
fn from_wire_option(wire: WireBox<'_, W>) -> Option<T>
wire
to an option of this type.§impl<T, W> FromWireOptionRef<WireBox<'_, W>> for Twhere
T: FromWireRef<W>,
impl<T, W> FromWireOptionRef<WireBox<'_, W>> for Twhere
T: FromWireRef<W>,
§fn from_wire_option_ref(wire: &WireBox<'_, W>) -> Option<T>
fn from_wire_option_ref(wire: &WireBox<'_, W>) -> Option<T>
wire
reference to an option of this type.