matroskin 0.1.0

whatsminer api client lib
Documentation
#![doc(
    html_logo_url = "https://raw.githubusercontent.com/TOwInOK/matroskin/refs/heads/main/.github/.content/logo.webp"
)]
//! # `matroskin`
//!
//! WhatsMiner v3 ApiDoc: <https://apidoc.whatsminer.com>
//!
//! `matroskin` is an asynchronous Rust library designed for interacting with WhatsMiner devices.
//! It provides an actor-based API to send commands and receive responses from WhatsMiner hardware,
//! facilitating monitoring and control functionalities.
//!
//! **Warning:** This library is developed primarily for personal use and may not be
//! fully optimized or extensively tested for public production environments. Hardware
//! timeouts (300ms) remain operational risks, and no physical hardware has been verified in CI.
//!
//! Note: Creating an [`Actor`](crate::actor::Actor) requires an active Tokio runtime context,
//! as it spawns an internal background task to manage connection lifecycle and mailboxes.
//!
//! Current status: [`list of done commands`](command#list-of-commands)
//!
//! # Usage Example
//!
//! ```rust,no_run
//! use matroskin::actor::Actor;
//! use matroskin::account::Account;
//! use matroskin::password::Password;
//! use matroskin::command::get_device_info::GetDeviceInfo;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//!     // 0. (Optional) init logger
//!     tracing_subscriber::fmt()
//!         .compact()
//!         .with_max_level(tracing::Level::INFO)
//!         .without_time()
//!         .init();
//!
//!     // 1. Initialize the actor in `Created` state (requires active Tokio runtime).
//!     let actor = Actor::new("10.10.10.10:4433", Account::Super, Password::Super);
//!
//!     // 2. Queue connection intent.
//!     actor.connect()?;
//!
//!     // 3. Send an owned command by value.
//!     // The command mailbox waits until the actor establishes a Connected session.
//!     let response = actor.send(GetDeviceInfo::all()).await?;
//!     println!("Response: {:#?}", response);
//!
//!     // 4. Graceful non-blocking shutdown intent.
//!     actor.shutdown()?;
//!     Ok(())
//! }
//! ```

pub mod account;
pub mod actor;
pub mod auth_data;
pub mod command;
pub mod error;
pub mod password;
pub mod permission;
pub mod redacted;
pub mod request;
pub mod response;