GunResult

Type Alias GunResult 

Source
pub type GunResult<T> = Result<T, GunError>;
Expand description

Result type alias for Gun operations

All Gun operations return GunResult<T> which is Result<T, GunError>. This provides consistent error handling across the entire library.

§Example

use gun::{Gun, GunResult};
use serde_json::json;
 
async fn put_data() -> GunResult<()> {
    let gun = Gun::new();
    gun.get("test").put(json!({"value": 42})).await?;
    Ok(())
}

Aliased Type§

pub enum GunResult<T> {
    Ok(T),
    Err(GunError),
}

Variants§

§1.0.0

Ok(T)

Contains the success value

§1.0.0

Err(GunError)

Contains the error value