Skip to main content

Server

Struct Server 

Source
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>

Source

pub fn new(input: BufReader<R>, output: BufWriter<W>) -> Self

Construct a new Server using the given input and output streams.

Source

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.

Source

pub fn send(&mut self, body: Sendable) -> Result<(), ServerError>

Source

pub fn respond(&mut self, response: Response) -> Result<(), ServerError>

Source

pub fn send_event(&mut self, event: Event) -> Result<(), ServerError>

Source

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>
where R: Send, W: Send,

§

impl<R, W> Sync for Server<R, W>
where R: Sync, W: Send,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.