pub struct CloudClient { /* private fields */ }Expand description
ctx.cloud — this plugin’s own cloud stream and cloud records.
Both go through the agent’s cloud relay under the plugin’s verified id, so a
plugin only ever publishes into its own namespace. The relay being down is
the resting state on an unpaired or offline node: both calls then answer a
not_available map rather than an error.
Implementations§
Source§impl CloudClient
impl CloudClient
Sourcepub async fn publish(
&self,
stream: &str,
payload: &[u8],
) -> Result<Value, ClientError>
pub async fn publish( &self, stream: &str, payload: &[u8], ) -> Result<Value, ClientError>
Publish one lossy message on the plugin’s cloud stream stream. Needs
cloud.publish. See PluginIpcClient::cloud_publish.
Sourcepub async fn put_record(
&self,
collection: &str,
key: &str,
data: Value,
device_id: Option<&str>,
) -> Result<Value, ClientError>
pub async fn put_record( &self, collection: &str, key: &str, data: Value, device_id: Option<&str>, ) -> Result<Value, ClientError>
Upsert the record key in the plugin’s cloud collection collection,
about device_id when given (else this node). Needs cloud.records.
See PluginIpcClient::cloud_records_put.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CloudClient
impl !UnwindSafe for CloudClient
impl Freeze for CloudClient
impl Send for CloudClient
impl Sync for CloudClient
impl Unpin for CloudClient
impl UnsafeUnpin for CloudClient
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