| Crates.io | praborrow-core |
| lib.rs | praborrow-core |
| version | 1.2.2 |
| created_at | 2026-01-09 15:07:31.180656+00 |
| updated_at | 2026-01-14 03:30:00.104791+00 |
| description | Core primitives for PraBorrow. Implements Sovereign |
| homepage | |
| repository | https://github.com/ireddragonicy/PraBorrow |
| max_upload_size | |
| id | 2032221 |
| size | 33,576 |
English | Indonesia
Core primitives for the PraBorrow distributed systems framework. This crate provides the foundational types for enforcing sovereign ownership semantics across network boundaries.
The Sovereign<T> wrapper implements a distinct state machine for data ownership:
Deref.Err with try_get).use praborrow_core::{Sovereign, SovereigntyError};
let data = Sovereign::new(42);
// Access allowed (Domestic)
assert_eq!(*data, 42);
// Safe access with error handling (v0.5+)
assert!(data.try_get().is_ok());
// Transition state
data.annex().expect("Failed to annex resource");
// Graceful error handling instead of panic
match data.try_get() {
Ok(_) => unreachable!(),
Err(SovereigntyError::ForeignJurisdiction) => println!("Exiled!"),
}
Uses AtomicU8 for state tracking, ensuring Send + Sync compliance where T: Send + Sync.