pub struct TelemetryClient {
url: String,
}Expand description
Client that connects to zerneld WebSocket and receives telemetry.
Fields§
§url: StringImplementations§
Source§impl TelemetryClient
impl TelemetryClient
pub fn new(host: &str, port: u16) -> Self
Sourcepub async fn try_connect(&self) -> Option<UnboundedReceiver<TelemetrySnapshot>>
pub async fn try_connect(&self) -> Option<UnboundedReceiver<TelemetrySnapshot>>
Try to connect to zerneld. Returns a receiver channel if successful. The connection runs in a background task with automatic reconnection.
async fn reader_loop( ws: WebSocketStream<MaybeTlsStream<TcpStream>>, tx: UnboundedSender<TelemetrySnapshot>, url: String, )
Auto Trait Implementations§
impl Freeze for TelemetryClient
impl RefUnwindSafe for TelemetryClient
impl Send for TelemetryClient
impl Sync for TelemetryClient
impl Unpin for TelemetryClient
impl UnwindSafe for TelemetryClient
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more