pub struct WeatherlinkClient { /* private fields */ }Implementations§
Source§impl WeatherlinkClient
impl WeatherlinkClient
pub fn new( timeout: Duration, wait_between_queries: Duration, ) -> Result<WeatherlinkClient>
Sourcepub async fn start_udp_broadcasts(
&mut self,
weatherlink_host: &str,
) -> Result<()>
pub async fn start_udp_broadcasts( &mut self, weatherlink_host: &str, ) -> Result<()>
Requests that the weatherlink start sending out broadcasts for the next 24 hours.
Sourcepub async fn get_current_conditions(
&mut self,
weatherlink_host: &str,
) -> Result<String>
pub async fn get_current_conditions( &mut self, weatherlink_host: &str, ) -> Result<String>
Queries the current_conditions endpoint, returns a string containing the JSON conditions section. Returns an error if the connection fails or times out, or if the response contains an error.
Sourcepub fn record_request(&mut self)
pub fn record_request(&mut self)
Records that a (non-http) request against the weatherlink has occurred elsewhere. This ensures that upcoming http requests don’t happen too soon.
Auto Trait Implementations§
impl Freeze for WeatherlinkClient
impl RefUnwindSafe for WeatherlinkClient
impl Send for WeatherlinkClient
impl Sync for WeatherlinkClient
impl Unpin for WeatherlinkClient
impl UnwindSafe for WeatherlinkClient
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