pub struct TcpClientBlocking { /* private fields */ }Expand description
Synchronous TCP subscription listener.
Connects to the TCP server at addr and sends the given subscription request
(encoded as JSON). It then spawns a dedicated thread that reads lines from the TCP
connection using non-blocking mode. If no data is available, it sleeps briefly and
then checks the shutdown flag again.
The listener will continue until either the TCP connection is closed or the provided
shutdown method is called.
§Arguments
addr- The address of the TCP subscription server (e.g., “127.0.0.1:9000”).subscription_request- The subscription request to send to the server.
§Returns
A Result containing a std::sync::mpsc::Receiver<Event> that will receive events from the server,
or an error.
Implementations§
Auto Trait Implementations§
impl Freeze for TcpClient
impl RefUnwindSafe for TcpClient
impl Send for TcpClient
impl Sync for TcpClient
impl Unpin for TcpClient
impl UnwindSafe for TcpClient
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