pub struct Server { /* private fields */ }Expand description
A set of Sender/Receiver objects for passing Messages around.
Implementations§
Source§impl Server
impl Server
Sourcepub fn new<T: Handler>(make_handler: impl FnOnce(Client) -> T) -> Self
pub fn new<T: Handler>(make_handler: impl FnOnce(Client) -> T) -> Self
Spawns the message handling thread. make_handler receives a Client for sending server-to-client messages.
pub fn tracer(&self) -> TracingLayer
pub fn listen_stdio(&self) -> Result<ThreadConnection, Error>
Sourcepub fn raw_channels(&self) -> (Sender<Message>, Receiver<Message>)
pub fn raw_channels(&self) -> (Sender<Message>, Receiver<Message>)
Returns the channels a transport would use: send client messages into the first, receive server messages from the second. Drives the server in-process without stdio.
Auto Trait Implementations§
impl !RefUnwindSafe for Server
impl !UnwindSafe for Server
impl Freeze for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
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