pub struct Atomic<Loc> { /* private fields */ }Expand description
A location wrapper that provides atomicity guarantees within a Tick.
An Atomic context establishes a happens-before relationship between operations:
- Downstream computations from
atomic()are associated with an internal tick - Outputs from
end_atomic()are held until all computations in the tick complete - Snapshots via
use::atomicare guaranteed to reflect all updates from associatedend_atomic()
This ensures read-after-write consistency: if a client receives an acknowledgement
from end_atomic(), any subsequent use::atomic snapshot will include the effects
of that acknowledged operation.
Trait Implementations§
Source§impl<'a, L> Location<'a> for Atomic<L>where
L: Location<'a>,
impl<'a, L> Location<'a> for Atomic<L>where
L: Location<'a>,
Source§type DropConsistency = Atomic<<L as Location<'a>>::DropConsistency>
type DropConsistency = Atomic<<L as Location<'a>>::DropConsistency>
Location type with consistency guarantees dropped for the live collection on it.
Source§fn consistency() -> Option<ClusterConsistency>
fn consistency() -> Option<ClusterConsistency>
Gets the runtime enum variant for the current consistency level, if this is a cluster.
Source§fn drop_consistency(&self) -> Self::DropConsistency
fn drop_consistency(&self) -> Self::DropConsistency
This location but with consistency guarantees dropped for the live collection
Source§fn with_consistency_of<L2: Location<'a, DropConsistency = Self::DropConsistency>>(
&self,
) -> L2
fn with_consistency_of<L2: Location<'a, DropConsistency = Self::DropConsistency>>( &self, ) -> L2
Updates the consistency guarantees to match that of the given location.
Source§fn id(&self) -> LocationId
fn id(&self) -> LocationId
Returns the unique identifier for this location.
Source§fn source_iter<T, E>(
&self,
e: impl QuotedWithContext<'a, E, Self>,
) -> Stream<T, Self::DropConsistency, Bounded, TotalOrder, ExactlyOnce>where
E: IntoIterator<Item = T>,
Self: Sized,
fn source_iter<T, E>(
&self,
e: impl QuotedWithContext<'a, E, Self>,
) -> Stream<T, Self::DropConsistency, Bounded, TotalOrder, ExactlyOnce>where
E: IntoIterator<Item = T>,
Self: Sized,
Creates a bounded stream from an iterator. Read more
Source§fn singleton<T>(
&self,
e: impl QuotedWithContext<'a, T, Self>,
) -> Singleton<T, Self::DropConsistency, Bounded>where
Self: Sized,
fn singleton<T>(
&self,
e: impl QuotedWithContext<'a, T, Self>,
) -> Singleton<T, Self::DropConsistency, Bounded>where
Self: Sized,
Source§fn singleton_future<F>(
&self,
e: impl QuotedWithContext<'a, F, Self>,
) -> Singleton<F::Output, Self::DropConsistency, Bounded>
fn singleton_future<F>( &self, e: impl QuotedWithContext<'a, F, Self>, ) -> Singleton<F::Output, Self::DropConsistency, Bounded>
Source§fn forward_ref<S>(&self) -> (ForwardHandle<'a, S>, S)where
S: CycleCollection<'a, ForwardRef, Location = Self>,
fn forward_ref<S>(&self) -> (ForwardHandle<'a, S>, S)where
S: CycleCollection<'a, ForwardRef, Location = Self>,
Creates a forward reference, allowing a stream to be used before its source is defined. Read more
Auto Trait Implementations§
impl<Loc> Freeze for Atomic<Loc>where
Loc: Freeze,
impl<Loc> RefUnwindSafe for Atomic<Loc>where
Loc: RefUnwindSafe,
impl<Loc> Send for Atomic<Loc>where
Loc: Send,
impl<Loc> Sync for Atomic<Loc>where
Loc: Sync,
impl<Loc> Unpin for Atomic<Loc>where
Loc: Unpin,
impl<Loc> UnsafeUnpin for Atomic<Loc>where
Loc: UnsafeUnpin,
impl<Loc> UnwindSafe for Atomic<Loc>where
Loc: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.
§impl<T> ToSinkBuild for T
impl<T> ToSinkBuild for T
§fn iter_to_sink_build(self) -> SendIterBuild<Self>
fn iter_to_sink_build(self) -> SendIterBuild<Self>
§fn stream_to_sink_build(self) -> SendStreamBuild<Self>where
Self: Sized + Stream,
fn stream_to_sink_build(self) -> SendStreamBuild<Self>where
Self: Sized + Stream,
Starts a [
SinkBuild] adaptor chain to send all items from self as a [Stream].