pub struct Client { /* private fields */ }Expand description
A client for drogue cloud command and control API, backed by reqwest.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(
client: Client,
api_url: Url,
token_provider: impl TokenProvider + 'static,
) -> Self
pub fn new( client: Client, api_url: Url, token_provider: impl TokenProvider + 'static, ) -> Self
Create a new client instance.
Sourcepub async fn publish_command<A, D, C, P>(
&self,
application: A,
device: D,
command: C,
payload: Option<P>,
) -> Result<Option<()>, ClientError>
pub async fn publish_command<A, D, C, P>( &self, application: A, device: D, command: C, payload: Option<P>, ) -> Result<Option<()>, ClientError>
Send one way commands to devices.
The result will be true if the command was accepted. False
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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