Skip to main content

Crate astarte_device_sdk

Crate astarte_device_sdk 

Source
Expand description

§Astarte Device SDK Rust  

Build Status Latest Version docs.rs Code coverage

The Astarte Device SDK for Rust is a ready to use library that provides communication and pairing primitives to an Astarte Cluster.

Quick links:

§Use the library

You can add the library to your project with:

cargo new astarte-project && cd astarte-project
cargo add astarte-device-sdk --features='derive'

§Examples

Check out how to start with the SDK using one of the included examples.

Re-exports§

pub use crate::client::Client;
pub use crate::client::DeviceClient;
pub use crate::connection::DeviceConnection;
pub use crate::connection::EventLoop;
pub use crate::error::Error;
pub use crate::event::Value;
pub use crate::event::DeviceEvent;
pub use crate::event::FromEvent;
pub use crate::types::AstarteData;
pub use astarte_interfaces;
pub use chrono;
pub use rumqttc;

Modules§

_docs
Documentation and examples on how to use the library.
aggregate
Value to send or receive from Astarte.
builder
Provides functionality to configure an instance of the DeviceClient and DeviceConnection.
client
Client to send data to astarte, add interfaces or access properties.
connection
Connection to Astarte, for handling events and reconnection on error.
error
Error types for the Astarte SDK.
event
Event returned form the loop.
introspection
Handle the introspection for the device
prelude
Prelude device module Re-exports common traits frequently used when using the astarte SDK API.
properties
Handles the properties for the device.
retention
Handles stored retention for the connections.
session
Handles the storage of the current introspection to maintain a persistent session with the Astarte MQTT server.
store
Provides functionality for instantiating an Astarte sqlite database.
transport
Astarte Connection Traits
types
Provides Astarte specific types to be used by the Client to transmit/receive data to/from the Astarte cluster.

Derive Macros§

FromEventderive
Derive macro #[derive(FromEvent)] to implement the FromEvent trait.
IntoAstarteObjectderive
Derive macro #[derive(IntoAstarteObject)] to implement IntoAstarteObject.