Cut down on macro nonsense

- InertAtomic replaced atomic_inert! for improved tooling support
- atomic_defaults! is easier to type out than to explain in a docstring
- Changed rustfmt config to better support tiny functions such as as_any
This commit is contained in:
2023-09-15 12:37:10 +01:00
parent 3c0056c2db
commit 0bcf10659b
73 changed files with 418 additions and 654 deletions

View File

@@ -1,17 +1,14 @@
use std::any::Any;
use std::collections::VecDeque;
use crate::interpreted::ExprInst;
use super::Canceller;
use crate::interpreted::ExprInst;
pub type SyncResult<T> = (T, Box<dyn Any + Send>);
pub type SyncOperation<T> =
Box<dyn FnOnce(T, Canceller) -> SyncResult<T> + Send>;
pub type SyncOpResultHandler<T> = Box<
dyn FnOnce(T, Box<dyn Any + Send>, Canceller) -> (T, Vec<ExprInst>),
>;
pub type SyncOpResultHandler<T> =
Box<dyn FnOnce(T, Box<dyn Any + Send>, Canceller) -> (T, Vec<ExprInst>)>;
struct SyncQueueItem<T> {
cancelled: Canceller,
@@ -89,9 +86,7 @@ impl<T> BusyState<T> {
self.seal = Some(Box::new(recipient))
}
pub fn is_sealed(&self) -> bool {
self.seal.is_some()
}
pub fn is_sealed(&self) -> bool { self.seal.is_some() }
pub fn rotate<U: Send + 'static>(
mut self,