Skip to main content

Crate blooio

Crate blooio 

Source
Expand description

§blooio

Typed, low-overhead Rust bindings for the Blooio API (iMessage / SMS automation), exposing both an async and a blocking surface from a single sans-IO core.

§Design

Every endpoint is described once as an Operation (its method, path, query, headers, body, and output type). Two thin executors — Client (async, reqwest) and BlockingClient (blocking, ureq) — perform the actual IO. Sync users pull no async runtime.

Hand-written resource handles provide the ergonomic surface:

use blooio::Client;

let client = Client::new("my-api-key")?;
let me = client.account().get().await?;
let chat = client.chat("chat-id");
chat.send_text("hello from rust").await?;

The Operation types are public, so anything not covered by a convenience method can be sent directly: client.send(op).await.

§Features

  • async (default) — the Client executor (reqwest).
  • sync — the BlockingClient executor (ureq), no tokio.
  • rustls (default) / native-tls — TLS backend selection.
  • webhooks (default) — typed payloads + HMAC signature verification.
  • axum / actix — webhook extractors for those frameworks (each implies webhooks).
  • tracing (default) — secret-redacted request instrumentation.

At least one of async / sync / webhooks must be enabled. A webhooks-only build does not compile either HTTP client executor.

§Resilience

Both executors retry transient failures (transport errors and the 408/425/429/5xx statuses) with jittered exponential backoff, honoring any Retry-After header. Tune or disable this via ClientConfig::with_retry and RetryPolicy. Mutating requests that are retried automatically carry an Idempotency-Key.

Use send_with_meta (on either client) to receive ResponseMeta — rate-limit headers and Retry-After — alongside the decoded response, so you can pace requests against the API’s limits.

Re-exports§

pub use config::ClientConfig;
pub use config::DEFAULT_BASE_URL;
pub use core::Listing;
pub use core::Operation;
pub use core::Page;
pub use core::Pagination;
pub use core::Paginator;
pub use core::RateLimit;
pub use core::ResponseMeta;
pub use core::RetryPolicy;
pub use error::Error;
pub use error::Result;
pub use secret::Secret;
pub use types::*;

Modules§

config
Client configuration.
core
Sans-IO core: operation descriptions, request/response plumbing, and pagination. Nothing here performs IO; the Client and BlockingClient executors do.
error
Error types for the crate.
resources
Hand-written resource namespaces. Each module defines its public Operation types plus a resource handle whose methods delegate to the client’s send.
secret
A redacting, zero-on-drop wrapper for sensitive values.
types
Shared serde models mirroring components.schemas from the OpenAPI spec.
webhook
Webhook payload types and signature verification.

Structs§

BlockingClient
Blocking Blooio API client.
Client
Asynchronous Blooio API client.