pub struct DataPointClient { /* private fields */ }Expand description
Holds the DataPoint channel and allows on-demand queries
Implementations§
Source§impl DataPointClient
impl DataPointClient
Sourcepub fn new(channel: AgentChannel) -> Self
pub fn new(channel: AgentChannel) -> Self
Create a new DataPoint client
Sourcepub async fn request(
&mut self,
names: Vec<String>,
) -> Result<Vec<(String, Option<Value>)>, Error>
pub async fn request( &mut self, names: Vec<String>, ) -> Result<Vec<(String, Option<Value>)>, Error>
Request the given named data points and return the responses. Each value is parsed as JSON if possible.
Sourcepub async fn run_idle_loop(self)
pub async fn run_idle_loop(self)
Hold the channel open indefinitely (keeps the mux alive) without making any requests. Returns when the channel closes.
Auto Trait Implementations§
impl Freeze for DataPointClient
impl RefUnwindSafe for DataPointClient
impl Send for DataPointClient
impl Sync for DataPointClient
impl Unpin for DataPointClient
impl UnsafeUnpin for DataPointClient
impl UnwindSafe for DataPointClient
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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