struct Behavior {
thunk: Box<dyn FnOnce() + Send>,
count: AtomicUsize,
requests: Vec<Request>,
}
Expand description
Behavior that captures the content of a when body.
Fields§
§thunk: Box<dyn FnOnce() + Send>
The body of the Behavior.
count: AtomicUsize
Number of not-yet enqueued requests.
requests: Vec<Request>
The requests for this behavior.
Implementations§
Source§impl Behavior
impl Behavior
Sourcefn schedule(self)
fn schedule(self)
Schedules the Behavior.
Performs two phase locking (2PL) over the enqueuing of the requests. This ensures that the overall effect of the enqueue is atomic.
Sourceunsafe fn resolve_one(this: *const Self)
unsafe fn resolve_one(this: *const Self)
Resolves a single outstanding request for this
.
Called when a request for this
is at the head of the queue for a particular cown. If it is
the last request, then the thunk is scheduled.
§Safety
this
must be a valid behavior.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Behavior
impl !RefUnwindSafe for Behavior
impl Send for Behavior
impl !Sync for Behavior
impl Unpin for Behavior
impl !UnwindSafe for Behavior
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