pub struct ServerOutput<W: Write> { /* private fields */ }Expand description
Handles emission of messages through the connection.
ServerOutput is responsible for sending messages to the connection.
It’s only accessible through a mutex that can be shared with other
threads. This makes it possible to send e.g. events while the server is
blocked polling requests.
Implementations§
Source§impl<W: Write> ServerOutput<W>
impl<W: Write> ServerOutput<W>
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<W> Freeze for ServerOutput<W>where
W: Freeze,
impl<W> RefUnwindSafe for ServerOutput<W>where
W: RefUnwindSafe,
impl<W> Send for ServerOutput<W>where
W: Send,
impl<W> Sync for ServerOutput<W>where
W: Sync,
impl<W> Unpin for ServerOutput<W>where
W: Unpin,
impl<W> UnsafeUnpin for ServerOutput<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for ServerOutput<W>where
W: 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