Module retry

Source
Expand description

Retry logic for BLE operations.

This module provides configurable retry functionality for handling transient BLE failures.

§Example

use aranet_core::{RetryConfig, with_retry, Error};

// Configure retry behavior (3 retries with default settings)
let config = RetryConfig::new(3);

// Or use aggressive settings for unreliable connections
let aggressive = RetryConfig::aggressive();

// Use with_retry to wrap fallible operations
let result = with_retry(&config, "read_sensor", || async {
    // Your BLE operation here
    Ok::<_, Error>(42)
}).await?;

Structs§

RetryConfig
Configuration for retry behavior.

Functions§

with_retry
Execute an async operation with retry logic.