Struct Server
pub struct Server<P, T = Channel>where
T: Transport,{ /* private fields */ }
Expand description
A strongly typed server.
Implementations§
§impl<P, T> Server<P, T>where
T: Transport,
impl<P, T> Server<P, T>where
T: Transport,
pub fn sender(&self) -> &ServerSender<P, T>
pub fn sender(&self) -> &ServerSender<P, T>
Returns the sender for the server.
pub fn from_untyped(server: Server<T>) -> Server<P, T>
pub fn from_untyped(server: Server<T>) -> Server<P, T>
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<H, T>,
pub async fn run<H>(
&mut self,
handler: H,
) -> Result<(), ProtocolError<<T as Transport>::Error>>where
P: ServerProtocol<H, T>,
Runs the server with the provided handler.
Trait Implementations§
Auto Trait Implementations§
impl<P, T> Freeze for Server<P, T>
impl<P, T> RefUnwindSafe for Server<P, T>where
<T as Transport>::Receiver: RefUnwindSafe,
P: RefUnwindSafe,
<T as Transport>::Sender: RefUnwindSafe,
impl<P, T> Sync for Server<P, T>
impl<P, T> Unpin for Server<P, T>
impl<P, T> UnwindSafe for Server<P, T>
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