pub struct ServerEnd<P, T = <P as HasTransport>::Transport> { /* private fields */ }Expand description
The server end of a protocol.
Implementations§
Source§impl<P, T> ServerEnd<P, T>
impl<P, T> ServerEnd<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> ServerEnd<P, T>
impl<P, T: Transport> ServerEnd<P, T>
Sourcepub fn spawn_full_on_with<H, E>(
self,
create_handler: impl FnOnce(Server<P, T>) -> H,
executor: &E,
) -> (HandlerTask<T, H, E>, Server<P, T>)
pub fn spawn_full_on_with<H, E>( self, create_handler: impl FnOnce(Server<P, T>) -> H, executor: &E, ) -> (HandlerTask<T, H, E>, Server<P, T>)
Spawns a dispatcher for the given server end with a handler computed from a closure on an executor.
Returns the join handle for the spawned task and the server.
Sourcepub fn spawn_full_on<H, E>(
self,
handler: H,
executor: &E,
) -> (HandlerTask<T, H, E>, Server<P, T>)
pub fn spawn_full_on<H, E>( self, handler: H, executor: &E, ) -> (HandlerTask<T, H, E>, Server<P, T>)
Spawns a dispatcher for the given server end with a handler on an executor.
Returns the join handle for the spawned task and the server.
Sourcepub fn spawn_on_with<H, E>(
self,
create_handler: impl FnOnce(Server<P, T>) -> H,
executor: &E,
) -> HandlerTask<T, H, E>
pub fn spawn_on_with<H, E>( self, create_handler: impl FnOnce(Server<P, T>) -> H, executor: &E, ) -> HandlerTask<T, H, E>
Spawns a dispatcher for the given server end with a handler computed from a closure on an executor.
Returns the join handle for the spawned task.
Sourcepub fn spawn_on<H, E>(self, handler: H, executor: &E) -> HandlerTask<T, H, E>
pub fn spawn_on<H, E>(self, handler: H, executor: &E) -> HandlerTask<T, H, E>
Spawns a dispatcher for the given server end with a handler on an executor.
Returns the join handle for the spawned task.
Sourcepub fn spawn_full_with<H>(
self,
create_handler: impl FnOnce(Server<P, T>) -> H,
) -> (HandlerTask<T, H>, Server<P, T>)
pub fn spawn_full_with<H>( self, create_handler: impl FnOnce(Server<P, T>) -> H, ) -> (HandlerTask<T, H>, Server<P, T>)
Spawns a dispatcher for the given server end with a handler computed from a closure on the default executor for the transport.
Returns the join handle for the spawned task and the server.
Sourcepub fn spawn_full<H>(self, handler: H) -> (HandlerTask<T, H>, Server<P, T>)
pub fn spawn_full<H>(self, handler: H) -> (HandlerTask<T, H>, Server<P, T>)
Spawns a dispatcher for the given server end with a handler on the default executor for the transport.
Returns the join handle for the spawned task and the server.
Sourcepub fn spawn_with<H>(
self,
create_handler: impl FnOnce(Server<P, T>) -> H,
) -> HandlerTask<T, H>
pub fn spawn_with<H>( self, create_handler: impl FnOnce(Server<P, T>) -> H, ) -> HandlerTask<T, H>
Spawns a dispatcher for the given server end with a handler computed from a closure on the default executor for the transport.
Returns the join handle for the spawned task.
Sourcepub fn spawn<H>(self, handler: H) -> HandlerTask<T, H>
pub fn spawn<H>(self, handler: H) -> HandlerTask<T, H>
Spawns a dispatcher for the given server end with a handler on the default executor for the transport.
Returns the join handle for the spawned task.
Trait Implementations§
Source§impl<P1, P2, T> CompatFrom<ServerEnd<P1>> for ServerEnd<P2, T>
impl<P1, P2, T> CompatFrom<ServerEnd<P1>> for ServerEnd<P2, T>
Source§fn compat_from(value: ServerEnd<P1>) -> Self
fn compat_from(value: ServerEnd<P1>) -> Self
value into a value of this type.Source§impl<P1, P2, T> CompatFrom<ServerEnd<P1, T>> for ServerEnd<P2>
impl<P1, P2, T> CompatFrom<ServerEnd<P1, T>> for ServerEnd<P2>
Source§fn compat_from(value: ServerEnd<P1, T>) -> Self
fn compat_from(value: ServerEnd<P1, T>) -> Self
value into a value of this type.Source§impl<D, P, T> Decode<D> for ServerEnd<P, T>
impl<D, P, T> Decode<D> for ServerEnd<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<ServerEnd<P, W>, E> for &'a ServerEnd<P, T>
impl<'a, W, E, P, T> Encode<ServerEnd<P, W>, E> for &'a ServerEnd<P, T>
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<ServerEnd<P, W>>,
constraint: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<ServerEnd<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<ServerEnd<P, W>, E> for ServerEnd<P, T>
impl<W, E, P, T> Encode<ServerEnd<P, W>, E> for ServerEnd<P, T>
Source§fn encode(
self,
encoder: &mut E,
out: &mut MaybeUninit<ServerEnd<P, W>>,
constraint: (),
) -> Result<(), EncodeError>
fn encode( self, encoder: &mut E, out: &mut MaybeUninit<ServerEnd<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<ServerEnd<P, W>, E> for &'a ServerEnd<P, T>
impl<'a, W, E, P, T> EncodeOption<ServerEnd<P, W>, E> for &'a ServerEnd<P, T>
Source§fn encode_option(
this: Option<Self>,
encoder: &mut E,
out: &mut MaybeUninit<ServerEnd<P, W>>,
constraint: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<ServerEnd<P, W>>, constraint: (), ) -> Result<(), EncodeError>
Source§impl<W, E, P, T> EncodeOption<ServerEnd<P, W>, E> for ServerEnd<P, T>
impl<W, E, P, T> EncodeOption<ServerEnd<P, W>, E> for ServerEnd<P, T>
Source§fn encode_option(
this: Option<Self>,
encoder: &mut E,
out: &mut MaybeUninit<ServerEnd<P, W>>,
constraint: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<Self>, encoder: &mut E, out: &mut MaybeUninit<ServerEnd<P, W>>, constraint: (), ) -> Result<(), EncodeError>
Source§impl<P, T, U> FromWire<ServerEnd<P, U>> for ServerEnd<P, T>where
T: FromWire<U>,
impl<P, T, U> FromWire<ServerEnd<P, U>> for ServerEnd<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<ServerEnd<P, U>> for ServerEnd<P, T>where
P: 'static,
T: FromWireOption<U>,
U: Wire,
impl<P, T, U> FromWireOption<ServerEnd<P, U>> for ServerEnd<P, T>where
P: 'static,
T: FromWireOption<U>,
U: Wire,
Source§fn from_wire_option(wire: ServerEnd<P, U>) -> Option<Self>
fn from_wire_option(wire: ServerEnd<P, U>) -> Option<Self>
wire to an option of this type.Source§impl<P, T, U> FromWireOptionRef<ServerEnd<P, U>> for ServerEnd<P, T>where
P: 'static,
T: FromWireOptionRef<U>,
U: Wire,
impl<P, T, U> FromWireOptionRef<ServerEnd<P, U>> for ServerEnd<P, T>where
P: 'static,
T: FromWireOptionRef<U>,
U: Wire,
Source§fn from_wire_option_ref(wire: &ServerEnd<P, U>) -> Option<Self>
fn from_wire_option_ref(wire: &ServerEnd<P, U>) -> Option<Self>
wire reference to an option of this type.Source§impl<P, T, U> FromWireRef<ServerEnd<P, U>> for ServerEnd<P, T>where
T: FromWireRef<U>,
impl<P, T, U> FromWireRef<ServerEnd<P, U>> for ServerEnd<P, T>where
T: FromWireRef<U>,
Source§fn from_wire_ref(wire: &ServerEnd<P, U>) -> Self
fn from_wire_ref(wire: &ServerEnd<P, U>) -> Self
wire reference to this type.Source§impl<P, T: IntoNatural> IntoNatural for ServerEnd<P, T>
impl<P, T: IntoNatural> IntoNatural for ServerEnd<P, T>
Source§type Natural = ServerEnd<P, <T as IntoNatural>::Natural>
type Natural = ServerEnd<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 ServerEnd<P, T>
impl<P: 'static, T: Wire> Wire for ServerEnd<P, T>
Source§type Owned<'de> = ServerEnd<P, <T as Wire>::Owned<'de>>
type Owned<'de> = ServerEnd<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 ServerEnd<P, T>
impl<P, T> StructuralPartialEq for ServerEnd<P, T>
impl<P, T: Sync> Sync for ServerEnd<P, T>
impl<P, T: Constrained<Constraint = ()>> Unconstrained for ServerEnd<P, T>
Auto Trait Implementations§
impl<P, T> Freeze for ServerEnd<P, T>where
T: Freeze,
impl<P, T> RefUnwindSafe for ServerEnd<P, T>where
T: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, T> Unpin for ServerEnd<P, T>
impl<P, T> UnwindSafe for ServerEnd<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