leasy 0.1.2

Distributed lease management library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use thiserror::Error;

#[derive(Error, Debug)]
pub enum LeaseError {
    #[error("Storage error: {0}")]
    Storage(String),
    #[error("Lease not found")]
    NotFound,
    #[error("Lease already acquired")]
    Conflict,
    #[error("Unknown error: {0}")]
    Unknown(String),
}

pub type Result<T> = std::result::Result<T, LeaseError>;