pub struct SharedPublication<Value> { /* private fields */ }Expand description
Briefly retains one captured reference and its reload coordinator.
Drop this prepared owner outside external control fences: it may be the final reference owner, whose value/resource destructors can run arbitrary code.
Implementations§
Sourcepub fn try_replace(&self, value: &mut Value) -> Result<bool, SharedAccessError>
pub fn try_replace(&self, value: &mut Value) -> Result<bool, SharedAccessError>
Swaps the captured value with the caller’s value without dropping either.
On success the slot contains the displaced value; otherwise it is unchanged. This lets an external cancellation owner hold its commit fence over the swap, then release that fence before dropping the displaced value. No user callback or value destructor runs here. Successful swaps supersede reloads.
§Errors
Returns Busy or Poisoned without changing the slot or reload authority.
Trait Implementations§
Auto Trait Implementations§
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