pub struct SocketForwarder<O: OutputSink> { /* private fields */ }
Expand description
Forwarder for a single output stream.
Implementations§
Source§impl<O: OutputSink> SocketForwarder<O>
impl<O: OutputSink> SocketForwarder<O>
Sourcepub fn try_new(socket: Socket, writer: &Writer<O>) -> Result<Self>
pub fn try_new(socket: Socket, writer: &Writer<O>) -> Result<Self>
Converts a a socket into a SocketForwarder.
Returns an error if conversion to an async socket fails.
Sourcepub async fn forward_text(&self, name: &str) -> Result<()>
pub async fn forward_text(&self, name: &str) -> Result<()>
Continuously forwards messages from the socket to the writer until the socket is closed.
Sourcepub async fn forward_json(&self, name: &str) -> Result<()>
pub async fn forward_json(&self, name: &str) -> Result<()>
Continuously forwards JSON data from the socket to the writer until the socket is closed.
Trait Implementations§
Source§impl<O: OutputSink> Clone for SocketForwarder<O>
impl<O: OutputSink> Clone for SocketForwarder<O>
Auto Trait Implementations§
impl<O> Freeze for SocketForwarder<O>where
O: Freeze,
impl<O> !RefUnwindSafe for SocketForwarder<O>
impl<O> !Send for SocketForwarder<O>
impl<O> !Sync for SocketForwarder<O>
impl<O> Unpin for SocketForwarder<O>where
O: Unpin,
impl<O> !UnwindSafe for SocketForwarder<O>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)