Struct updatehub_sdk::Client
source · [−]pub struct Client { /* private fields */ }
Expand description
The Client
allow for requests to be sent.
Implementations
Probe the agent for update.
Example
let client = updatehub_sdk::Client::default();
let response = client.probe(None).await?;
A custom address can be used:
let client = updatehub_sdk::Client::default();
let response = client.probe(Some("http://foo.bar".to_string())).await?;
Errors
This method fails when cannot complete the request at the address or
cannot parse the body json as a probe::Response
.
Request agent to install a local update package passing a path as argument.
Example
let path = std::path::Path::new("/tmp/my-update-package.uhupkg");
let client = updatehub_sdk::Client::default();
let response = client.local_install(path).await?;
Errors
This method fails when cannot complete the request at the address or
cannot parse the body json as a state::Response
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Client
impl !UnwindSafe for Client
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more