pub struct ClientEnd<P, T = <P as HasTransport>::Transport> { /* 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_handler_full_on_with<H, E>(
    self,
    create_handler: impl FnOnce(Client<P, T>) -> H,
    executor: &E,
) -> (Client<P, T>, HandlerTask<T, H, E>)
 
pub fn spawn_handler_full_on_with<H, E>( self, create_handler: impl FnOnce(Client<P, T>) -> H, executor: &E, ) -> (Client<P, T>, HandlerTask<T, H, E>)
Spawns a dispatcher for the given client end with a handler computed from a closure on an executor.
Returns the client and a join handle for the spawned task.
Sourcepub fn spawn_handler_full_on<H, E>(
    self,
    handler: H,
    executor: &E,
) -> (Client<P, T>, HandlerTask<T, H, E>)
 
pub fn spawn_handler_full_on<H, E>( self, handler: H, executor: &E, ) -> (Client<P, T>, HandlerTask<T, H, E>)
Spawns a dispatcher for the given client end with a handler on an executor.
Returns the client and a join handle for the spawned task.
Sourcepub fn spawn_handler_on_with<H, E>(
    self,
    create_handler: impl FnOnce(Client<P, T>) -> H,
    executor: &E,
) -> Client<P, T>
 
pub fn spawn_handler_on_with<H, E>( self, create_handler: impl FnOnce(Client<P, T>) -> H, executor: &E, ) -> Client<P, T>
Spawns a dispatcher for the given client end with a handler computed from a closure on an executor.
Returns the client.
Sourcepub fn spawn_handler_on<H, E>(self, handler: H, executor: &E) -> Client<P, T>
 
pub fn spawn_handler_on<H, E>(self, handler: H, executor: &E) -> Client<P, T>
Spawns a dispatcher for the given client end with a handler on an executor.
Returns the client.
Sourcepub fn spawn_handler_full_with<H>(
    self,
    create_handler: impl FnOnce(Client<P, T>) -> H,
) -> (Client<P, T>, HandlerTask<T, H>)
 
pub fn spawn_handler_full_with<H>( self, create_handler: impl FnOnce(Client<P, T>) -> H, ) -> (Client<P, T>, HandlerTask<T, H>)
Spawns a dispatcher for the given client end with a handler computed from a closure on the default executor for the transport.
Returns the client and a join handle for the spawned task.
Sourcepub fn spawn_handler_full<H>(
    self,
    handler: H,
) -> (Client<P, T>, HandlerTask<T, H>)
 
pub fn spawn_handler_full<H>( self, handler: H, ) -> (Client<P, T>, HandlerTask<T, H>)
Spawns a dispatcher for the given client end with a handler on the default executor for the transport.
Returns the client and a join handle for the spawned task.
Sourcepub fn spawn_handler_with<H>(
    self,
    create_handler: impl FnOnce(Client<P, T>) -> H,
) -> Client<P, T>
 
pub fn spawn_handler_with<H>( self, create_handler: impl FnOnce(Client<P, T>) -> H, ) -> Client<P, T>
Spawns a dispatcher for the given client end with a handler computed from a closure on the default executor for the transport.
Returns the client.
Sourcepub fn spawn_handler<H>(self, handler: H) -> Client<P, T>
 
pub fn spawn_handler<H>(self, handler: H) -> Client<P, T>
Spawns a dispatcher for the given client end with a handler on the default executor for the transport.
Returns the client.
Sourcepub fn spawn_full_on<E>(
    self,
    executor: &E,
) -> (Client<P, T>, HandlerTask<T, (), E>)
 
pub fn spawn_full_on<E>( self, executor: &E, ) -> (Client<P, T>, HandlerTask<T, (), E>)
Spawns a dispatcher for the given client end on an executor.
The spawned dispatcher will ignore all incoming events. Returns the client and a join handle for the spawned task.
Sourcepub fn spawn_on<E>(self, executor: &E) -> Client<P, T>
 
pub fn spawn_on<E>(self, executor: &E) -> Client<P, T>
Spawns a dispatcher for the given client end on an executor.
The spawned dispatcher will ignore all incoming events. Returns the client.
Sourcepub fn spawn_full(self) -> (Client<P, T>, HandlerTask<T, ()>)
 
pub fn spawn_full(self) -> (Client<P, T>, HandlerTask<T, ()>)
Spawns a dispatcher for the given client end on the default executor for the transport.
The spawned dispatcher will ignore all incoming events. Returns the client and a join handle for the spawned task.
Trait Implementations§
Source§impl<P1, P2, T> CompatFrom<ClientEnd<P1>> for ClientEnd<P2, T>
 
impl<P1, P2, T> CompatFrom<ClientEnd<P1>> for ClientEnd<P2, T>
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>
 
impl<P1, P2, T> CompatFrom<ClientEnd<P1, T>> for ClientEnd<P2>
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<D, P, T> Decode<D> for ClientEnd<P, T>
 
impl<D, P, T> Decode<D> for ClientEnd<P, T>
Source§fn decode(
    slot: Slot<'_, Self>,
    decoder: &mut D,
    constraint: <Self as Constrained>::Constraint,
) -> Result<(), DecodeError>
 
fn decode( slot: Slot<'_, Self>, decoder: &mut D, constraint: <Self as Constrained>::Constraint, ) -> Result<(), DecodeError>
Source§impl<'a, W, E, P, T> Encode<ClientEnd<P, W>, E> for &'a ClientEnd<P, T>
 
impl<'a, W, E, P, T> Encode<ClientEnd<P, W>, E> for &'a ClientEnd<P, T>
Source§fn encode(
    self,
    encoder: &mut E,
    out: &mut MaybeUninit<ClientEnd<P, W>>,
    constraint: (),
) -> Result<(), EncodeError>
 
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<ClientEnd<P, W>>, constraint: (), ) -> Result<(), EncodeError>
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
 
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl<W, E, P, T> Encode<ClientEnd<P, W>, E> for ClientEnd<P, T>
 
impl<W, E, P, T> Encode<ClientEnd<P, W>, E> for ClientEnd<P, T>
Source§fn encode(
    self,
    encoder: &mut E,
    out: &mut MaybeUninit<ClientEnd<P, W>>,
    constraint: (),
) -> Result<(), EncodeError>
 
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<ClientEnd<P, W>>, constraint: (), ) -> Result<(), EncodeError>
Source§const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
 
const COPY_OPTIMIZATION: CopyOptimization<Self, W> = _
Source§impl<'a, W, E, P, T> EncodeOption<ClientEnd<P, W>, E> for &'a ClientEnd<P, T>
 
impl<'a, W, E, P, T> EncodeOption<ClientEnd<P, W>, E> for &'a ClientEnd<P, T>
Source§fn encode_option(
    this: Option<Self>,
    encoder: &mut E,
    out: &mut MaybeUninit<ClientEnd<P, W>>,
    constraint: (),
) -> Result<(), EncodeError>
 
fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<ClientEnd<P, W>>, constraint: (), ) -> Result<(), EncodeError>
Source§impl<W, E, P, T> EncodeOption<ClientEnd<P, W>, E> for ClientEnd<P, T>
 
impl<W, E, P, T> EncodeOption<ClientEnd<P, W>, E> for ClientEnd<P, T>
Source§fn encode_option(
    this: Option<Self>,
    encoder: &mut E,
    out: &mut MaybeUninit<ClientEnd<P, W>>,
    constraint: (),
) -> Result<(), EncodeError>
 
fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<ClientEnd<P, W>>, constraint: (), ) -> Result<(), EncodeError>
Source§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>,
Source§const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
 
const COPY_OPTIMIZATION: CopyOptimization<W, Self> = _
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, T: IntoNatural> IntoNatural for ClientEnd<P, T>
 
impl<P, T: IntoNatural> IntoNatural for ClientEnd<P, T>
Source§type Natural = ClientEnd<P, <T as IntoNatural>::Natural>
 
type Natural = ClientEnd<P, <T as IntoNatural>::Natural>
Source§fn into_natural(self) -> Self::Natural
 
fn into_natural(self) -> Self::Natural
Source§impl<P: 'static, T: Wire> Wire for ClientEnd<P, T>
 
impl<P: 'static, T: Wire> Wire for ClientEnd<P, T>
Source§type Owned<'de> = ClientEnd<P, <T as Wire>::Owned<'de>>
 
type Owned<'de> = ClientEnd<P, <T as Wire>::Owned<'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> StructuralPartialEq for ClientEnd<P, T>
impl<P, T: Sync> Sync for ClientEnd<P, T>
impl<P, T: Constrained<Constraint = ()>> Unconstrained 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> Constrained for Twhere
    T: Unconstrained,
 
impl<T> Constrained for Twhere
    T: Unconstrained,
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,
Source§impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
    T: FromWire<W>,
 
impl<T, W> FromWireOption<WireBox<'_, W>> for Twhere
    T: FromWire<W>,
Source§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.Source§impl<T, W> FromWireOptionRef<WireBox<'_, W>> for Twhere
    T: FromWireRef<W>,
 
impl<T, W> FromWireOptionRef<WireBox<'_, W>> for Twhere
    T: FromWireRef<W>,
Source§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.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
T to Self