pub struct Server<T: Transport, P> { /* private fields */ }
Expand description
A strongly typed server.
Implementations§
Source§impl<T: Transport, P> Server<T, P>
impl<T: Transport, P> Server<T, P>
Sourcepub fn sender(&self) -> &ServerSender<T, P>
pub fn sender(&self) -> &ServerSender<T, P>
Returns the sender for the server.
Sourcepub fn from_untyped(server: Server<T>) -> Self
pub fn from_untyped(server: Server<T>) -> Self
Creates a new server from an untyped server.
Sourcepub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<T::Error>>where
P: ServerProtocol<T, H>,
pub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<T::Error>>where
P: ServerProtocol<T, H>,
Runs the server with the provided handler.
Auto Trait Implementations§
impl<T, P> Freeze for Server<T, P>
impl<T, P> RefUnwindSafe for Server<T, P>where
<T as Transport>::Receiver: RefUnwindSafe,
P: RefUnwindSafe,
<T as Transport>::Sender: RefUnwindSafe,
impl<T, P> Send for Server<T, P>where
P: Send,
impl<T, P> Sync for Server<T, P>
impl<T, P> Unpin for Server<T, P>
impl<T, P> UnwindSafe for Server<T, P>
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
Mutably borrows from an owned value. Read more