netbeam/sync/primitives/
mod.rs

1//! Network Synchronization Primitives Module
2//!
3//! This module provides distributed synchronization primitives that work across network boundaries.
4//! These primitives enable synchronized access to shared state between different network endpoints.
5//!
6//! # Features
7//! - Network-aware mutex for exclusive access across endpoints
8//! - Network-aware read-write lock for shared/exclusive access across endpoints
9//! - Trait definitions for network-compatible objects
10//!
11//! # Important Notes
12//! - All primitives require objects to implement the `NetObject` trait
13//! - Objects must be serializable, deserializable, and thread-safe
14//! - Network operations may fail due to connection issues, so error handling is essential
15//!
16//! # Related Components
17//! - [`net_mutex`] - Distributed mutual exclusion
18//! - [`net_rwlock`] - Distributed read-write locking
19
20use serde::de::DeserializeOwned;
21use serde::Serialize;
22use std::fmt::Debug;
23
24pub mod net_mutex;
25pub mod net_rwlock;
26
27pub trait NetObject: Debug + Serialize + DeserializeOwned + Send + Sync + Clone + 'static {}
28impl<T: Debug + Serialize + DeserializeOwned + Send + Sync + Clone + 'static> NetObject for T {}