Struct Server
pub struct Server<T, P>where
T: Transport,{ /* private fields */ }
Expand description
A strongly typed server.
Implementations§
§impl<T, P> Server<T, P>where
T: Transport,
impl<T, P> Server<T, P>where
T: Transport,
pub fn sender(&self) -> &ServerSender<T, P>
pub fn sender(&self) -> &ServerSender<T, P>
Returns the sender for the server.
pub fn from_untyped(server: Server<T>) -> Server<T, P>
pub fn from_untyped(server: Server<T>) -> Server<T, P>
Creates a new server from an untyped server.
pub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<<T as Transport>::Error>>where
P: ServerProtocol<T, H>,
pub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<<T as Transport>::Error>>where
P: ServerProtocol<T, H>,
Runs the server with the provided handler.
Trait Implementations§
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> 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