pub struct RepoLocks { /* private fields */ }Expand description
A keyed set of async mutexes, one per <owner>/<repo>.
§Examples
let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
rt.block_on(async {
let locks = solid_pod_rs_forge::locks::RepoLocks::default();
let g = locks.lock("alice", "demo").await;
// A second acquisition of the same key waits; another key does not.
let other = locks.lock("alice", "other").await;
drop(other);
drop(g);
});Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for RepoLocks
impl RefUnwindSafe for RepoLocks
impl Send for RepoLocks
impl Sync for RepoLocks
impl Unpin for RepoLocks
impl UnsafeUnpin for RepoLocks
impl UnwindSafe for RepoLocks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more