2024-04-09 13:25:23 +02:00

26 lines
510 B
Rust

#![allow(warnings)]
use anyhow::Error;
use std::fmt::Debug;
use std::sync::{Mutex, MutexGuard};
mod Prd_list;
pub mod api;
mod crypto;
mod images;
mod network;
mod peers;
mod process;
mod silentpayments;
mod user;
pub(crate) trait MutexExt<T> {
fn lock_anyhow(&self) -> Result<MutexGuard<T>, Error>;
}
impl<T: Debug> MutexExt<T> for Mutex<T> {
fn lock_anyhow(&self) -> Result<MutexGuard<T>, Error> {
self.lock()
.map_err(|e| Error::msg(format!("Failed to lock: {}", e)))
}
}