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) -> ServerEnd<P, T>
pub fn from_untyped(transport: T) -> ServerEnd<P, T>
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 as HasExecutor>::Executorwhere
T: HasExecutor,
pub fn executor(&self) -> <T as HasExecutor>::Executorwhere
T: HasExecutor,
Returns the executor for the underlying transport.
Source§impl<P, T> ServerEnd<P, T>where
T: Transport,
impl<P, T> ServerEnd<P, T>where
T: Transport,
Sourcepub fn spawn_full_on_with<H, E>(
self,
create_handler: impl FnOnce(Server<P, T>) -> H,
executor: &E,
) -> (<E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, Server<P, T>)
pub fn spawn_full_on_with<H, E>( self, create_handler: impl FnOnce(Server<P, T>) -> H, executor: &E, ) -> (<E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, 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,
) -> (<E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, Server<P, T>)
pub fn spawn_full_on<H, E>( self, handler: H, executor: &E, ) -> (<E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, 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,
) -> <E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
pub fn spawn_on_with<H, E>( self, create_handler: impl FnOnce(Server<P, T>) -> H, executor: &E, ) -> <E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
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,
) -> <E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
pub fn spawn_on<H, E>( self, handler: H, executor: &E, ) -> <E as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
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,
) -> (<<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, Server<P, T>)
pub fn spawn_full_with<H>( self, create_handler: impl FnOnce(Server<P, T>) -> H, ) -> (<<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, 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,
) -> (<<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, Server<P, T>)
pub fn spawn_full<H>( self, handler: H, ) -> (<<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>, 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,
) -> <<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
pub fn spawn_with<H>( self, create_handler: impl FnOnce(Server<P, T>) -> H, ) -> <<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
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,
) -> <<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
pub fn spawn<H>( self, handler: H, ) -> <<T as HasExecutor>::Executor as Executor>::Task<Result<H, ProtocolError<<T as Transport>::Error>>>
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>) -> ServerEnd<P2, T>
fn compat_from(value: ServerEnd<P1>) -> ServerEnd<P2, T>
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>) -> ServerEnd<P2>
fn compat_from(value: ServerEnd<P1, T>) -> ServerEnd<P2>
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<'_, ServerEnd<P, T>>,
decoder: &mut D,
constraint: <ServerEnd<P, T> as Constrained>::Constraint,
) -> Result<(), DecodeError>
fn decode( slot: Slot<'_, ServerEnd<P, T>>, decoder: &mut D, constraint: <ServerEnd<P, T> 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<&'a ServerEnd<P, T>>,
encoder: &mut E,
out: &mut MaybeUninit<ServerEnd<P, W>>,
constraint: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<&'a ServerEnd<P, T>>, 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<ServerEnd<P, T>>,
encoder: &mut E,
out: &mut MaybeUninit<ServerEnd<P, W>>,
constraint: (),
) -> Result<(), EncodeError>
fn encode_option( this: Option<ServerEnd<P, T>>, 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§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§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>) -> ServerEnd<P, T>
fn from_wire_ref(wire: &ServerEnd<P, U>) -> ServerEnd<P, T>
wire reference to this type.Source§impl<P, T> IntoNatural for ServerEnd<P, T>where
T: IntoNatural,
impl<P, T> IntoNatural for ServerEnd<P, T>where
T: IntoNatural,
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
impl<P, T> Send for ServerEnd<P, T>where
T: Send,
impl<P, T> StructuralPartialEq for ServerEnd<P, T>
impl<P, T> Sync for ServerEnd<P, T>where
T: Sync,
impl<P, T> Unconstrained for ServerEnd<P, T>where
T: Constrained<Constraint = ()>,
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,
§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, 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