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 tro 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::aggregate::AstarteAggregate;
pub use crate::aggregate::Value;
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::DeviceEvent;
pub use crate::event::FromEvent;
pub use crate::interface::Interface;
pub use crate::types::AstarteType;
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.
interface
Provides the functionalities to parse and validate an Astarte interface.
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.
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§

AstarteAggregatederive
Derive macro #[derive(AstarteAggregate)] to implement AstarteAggregate.
FromEventderive
Derive macro #[derive(FromEvent)] to implement the FromEvent trait.