Struct ClientEnd
pub struct ClientEnd<P, T = Channel> { /* private fields */ }
Expand description
The client end of a protocol.
Implementations§
§impl<P, T> ClientEnd<P, T>
impl<P, T> ClientEnd<P, T>
pub fn from_untyped(transport: T) -> ClientEnd<P, T>
pub fn from_untyped(transport: T) -> ClientEnd<P, T>
Returns a new endpoint over the given transport.
pub fn into_untyped(self) -> T
pub fn into_untyped(self) -> T
Returns the underlying transport.
pub fn executor(&self) -> <T as HasExecutor>::Executorwhere
T: HasExecutor,
pub fn executor(&self) -> <T as HasExecutor>::Executorwhere
T: HasExecutor,
Returns the executor for the underlying transport.
§impl<P, T> ClientEnd<P, T>where
T: Transport,
impl<P, T> ClientEnd<P, T>where
T: Transport,
pub fn spawn_full_with_handler_on<H, E>(
self,
handler: H,
executor: &E,
) -> (ClientSender<P, T>, <E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>)
pub fn spawn_full_with_handler_on<H, E>( self, handler: H, executor: &E, ) -> (ClientSender<P, T>, <E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>)
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.
pub 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.
pub fn spawn_full_with_handler<H>(
self,
handler: H,
) -> (ClientSender<P, T>, <<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>)
pub fn spawn_full_with_handler<H>( self, handler: H, ) -> (ClientSender<P, T>, <<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>)
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.
pub 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.
pub fn spawn_full_on<E>(
self,
executor: &E,
) -> (ClientSender<P, T>, <E as Executor>::Task<Result<(), ProtocolError<<T as Transport>::Error>>>)where
P: 'static,
T: 'static,
E: Executor,
pub fn spawn_full_on<E>(
self,
executor: &E,
) -> (ClientSender<P, T>, <E as Executor>::Task<Result<(), ProtocolError<<T as Transport>::Error>>>)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.
pub 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.
pub fn spawn_full(
self,
) -> (ClientSender<P, T>, <<T as HasExecutor>::Executor as Executor>::Task<Result<(), ProtocolError<<T as Transport>::Error>>>)where
P: 'static,
T: HasExecutor + 'static,
pub fn spawn_full(
self,
) -> (ClientSender<P, T>, <<T as HasExecutor>::Executor as Executor>::Task<Result<(), ProtocolError<<T as Transport>::Error>>>)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.
pub 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§
§impl<P1, P2, T> CompatFrom<ClientEnd<P1>> for ClientEnd<P2, T>
impl<P1, P2, T> CompatFrom<ClientEnd<P1>> for ClientEnd<P2, T>
§fn compat_from(value: ClientEnd<P1>) -> ClientEnd<P2, T>
fn compat_from(value: ClientEnd<P1>) -> ClientEnd<P2, T>
value
into a value of this type.§impl<P1, P2, T> CompatFrom<ClientEnd<P1, T>> for ClientEnd<P2>
impl<P1, P2, T> CompatFrom<ClientEnd<P1, T>> for ClientEnd<P2>
§fn compat_from(value: ClientEnd<P1, T>) -> ClientEnd<P2>
fn compat_from(value: ClientEnd<P1, T>) -> ClientEnd<P2>
value
into a value of this type.§impl<P, T> Encodable for ClientEnd<P, T>where
T: Encodable,
P: 'static,
impl<P, T> Encodable for ClientEnd<P, T>where
T: Encodable,
P: 'static,
§const COPY_OPTIMIZATION: CopyOptimization<Self, Self::Encoded> = _
const COPY_OPTIMIZATION: CopyOptimization<Self, Self::Encoded> = _
Self
to Self::Encoded
is equivalent to copying the raw bytes
of Self
. Read more§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,
§type EncodedOption = ClientEnd<P, <T as EncodableOption>::EncodedOption>
type EncodedOption = ClientEnd<P, <T as EncodableOption>::EncodedOption>
§impl<E, P, T> Encode<E> for ClientEnd<P, T>
impl<E, P, T> Encode<E> for ClientEnd<P, T>
§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<<ClientEnd<P, T> as Encodable>::Encoded>,
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<<ClientEnd<P, T> as Encodable>::Encoded>, ) -> Result<(), EncodeError>
§impl<E, P, T> EncodeOption<E> for ClientEnd<P, T>where
P: 'static,
T: EncodeOption<E>,
E: ?Sized,
impl<E, P, T> EncodeOption<E> for ClientEnd<P, T>where
P: 'static,
T: EncodeOption<E>,
E: ?Sized,
§fn encode_option(
this: Option<ClientEnd<P, T>>,
encoder: &mut E,
out: &mut MaybeUninit<<ClientEnd<P, T> as EncodableOption>::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option( this: Option<ClientEnd<P, T>>, encoder: &mut E, out: &mut MaybeUninit<<ClientEnd<P, T> as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>
§impl<E, P, T> EncodeOptionRef<E> for ClientEnd<P, T>where
P: 'static,
T: EncodeOptionRef<E>,
E: ?Sized,
impl<E, P, T> EncodeOptionRef<E> for ClientEnd<P, T>where
P: 'static,
T: EncodeOptionRef<E>,
E: ?Sized,
§fn encode_option_ref(
this: Option<&ClientEnd<P, T>>,
encoder: &mut E,
out: &mut MaybeUninit<<ClientEnd<P, T> as EncodableOption>::EncodedOption>,
) -> Result<(), EncodeError>
fn encode_option_ref( this: Option<&ClientEnd<P, T>>, encoder: &mut E, out: &mut MaybeUninit<<ClientEnd<P, T> as EncodableOption>::EncodedOption>, ) -> Result<(), EncodeError>
§impl<E, P, T> EncodeRef<E> for ClientEnd<P, T>
impl<E, P, T> EncodeRef<E> for ClientEnd<P, T>
§fn encode_ref(
&self,
encoder: &mut E,
out: &mut MaybeUninit<<ClientEnd<P, T> as Encodable>::Encoded>,
) -> Result<(), EncodeError>
fn encode_ref( &self, encoder: &mut E, out: &mut MaybeUninit<<ClientEnd<P, T> as Encodable>::Encoded>, ) -> Result<(), EncodeError>
§impl<P, T, U> FromWire<ClientEnd<P, U>> for ClientEnd<P, T>where
T: FromWire<U>,
impl<P, T, U> FromWire<ClientEnd<P, U>> for ClientEnd<P, T>where
T: FromWire<U>,
§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
§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,
§fn from_wire_option(wire: ClientEnd<P, U>) -> Option<ClientEnd<P, T>>
fn from_wire_option(wire: ClientEnd<P, U>) -> Option<ClientEnd<P, T>>
wire
to an option of this type.§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,
§fn from_wire_option_ref(wire: &ClientEnd<P, U>) -> Option<ClientEnd<P, T>>
fn from_wire_option_ref(wire: &ClientEnd<P, U>) -> Option<ClientEnd<P, T>>
wire
reference to an option of this type.§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>,
§fn from_wire_ref(wire: &ClientEnd<P, U>) -> ClientEnd<P, T>
fn from_wire_ref(wire: &ClientEnd<P, U>) -> ClientEnd<P, T>
wire
reference to this type.§impl<P, T> Wire for ClientEnd<P, T>where
P: 'static,
T: Wire,
impl<P, T> Wire for ClientEnd<P, T>where
P: 'static,
T: Wire,
§type Decoded<'de> = ClientEnd<P, <T as Wire>::Decoded<'de>>
type Decoded<'de> = ClientEnd<P, <T as Wire>::Decoded<'de>>
'de
lifetime.§fn zero_padding(out: &mut MaybeUninit<ClientEnd<P, T>>)
fn zero_padding(out: &mut MaybeUninit<ClientEnd<P, T>>)
impl<P, T> Send for ClientEnd<P, T>where
T: Send,
impl<P, T> Sync for ClientEnd<P, T>where
T: Sync,
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.