pub struct Server<R: Read, W: Write> {
pub output: Arc<Mutex<ServerOutput<W>>>,
/* private fields */
}Expand description
Handles message encoding and decoding of messages.
The Server is responsible for reading the incoming bytestream and constructing deserialized
requests from it, as well as constructing and serializing outgoing messages.
Fields§
§output: Arc<Mutex<ServerOutput<W>>>A sharable ServerOutput object for sending messages and events from
other threads.
Implementations§
Source§impl<R: Read, W: Write> Server<R, W>
impl<R: Read, W: Write> Server<R, W>
Sourcepub fn new(input: BufReader<R>, output: BufWriter<W>) -> Self
pub fn new(input: BufReader<R>, output: BufWriter<W>) -> Self
Construct a new Server using the given input and output streams.
Sourcepub fn poll_request(&mut self) -> Result<Option<Request>, ServerError>
pub fn poll_request(&mut self) -> Result<Option<Request>, ServerError>
Wait for a request from the development tool
This will start reading the input buffer that is passed to it and will try to interpret
the incoming bytes according to the DAP protocol.
pub fn send(&mut self, body: Sendable) -> Result<(), ServerError>
pub fn respond(&mut self, response: Response) -> Result<(), ServerError>
pub fn send_event(&mut self, event: Event) -> Result<(), ServerError>
pub fn send_reverse_request( &mut self, request: ReverseRequest, ) -> Result<(), ServerError>
Auto Trait Implementations§
impl<R, W> Freeze for Server<R, W>where
R: Freeze,
impl<R, W> RefUnwindSafe for Server<R, W>where
R: RefUnwindSafe,
impl<R, W> Send for Server<R, W>
impl<R, W> Sync for Server<R, W>
impl<R, W> Unpin for Server<R, W>where
R: Unpin,
impl<R, W> UnsafeUnpin for Server<R, W>where
R: UnsafeUnpin,
impl<R, W> UnwindSafe for Server<R, W>where
R: 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
Mutably borrows from an owned value. Read more