pub struct Singleton<Type, Loc, Bound: Boundedness> { /* private fields */ }
Implementations§
Source§impl<'a, T, L, B: Boundedness> Singleton<T, L, B>where
L: Location<'a>,
impl<'a, T, L, B: Boundedness> Singleton<T, L, B>where
L: Location<'a>,
pub fn map<U, F>(self, f: impl IntoQuotedMut<'a, F, L>) -> Singleton<U, L, B>where
F: Fn(T) -> U + 'a,
pub fn flat_map_ordered<U, I, F>(
self,
f: impl IntoQuotedMut<'a, F, L>,
) -> Stream<U, L, B, TotalOrder, ExactlyOnce>where
I: IntoIterator<Item = U>,
F: Fn(T) -> I + 'a,
pub fn flat_map_unordered<U, I, F>(
self,
f: impl IntoQuotedMut<'a, F, L>,
) -> Stream<U, L, B, NoOrder, ExactlyOnce>where
I: IntoIterator<Item = U>,
F: Fn(T) -> I + 'a,
pub fn flatten_ordered<U>(self) -> Stream<U, L, B, TotalOrder, ExactlyOnce>where
T: IntoIterator<Item = U>,
pub fn flatten_unordered<U>(self) -> Stream<U, L, B, NoOrder, ExactlyOnce>where
T: IntoIterator<Item = U>,
pub fn filter<F>(self, f: impl IntoQuotedMut<'a, F, L>) -> Optional<T, L, B>
pub fn filter_map<U, F>( self, f: impl IntoQuotedMut<'a, F, L>, ) -> Optional<U, L, B>
pub fn zip<O>(self, other: O) -> <Self as ZipResult<'a, O>>::Outwhere
Self: ZipResult<'a, O, Location = L>,
pub fn continue_if<U>( self, signal: Optional<U, L, Bounded>, ) -> Optional<T, L, Bounded>
pub fn continue_unless<U>( self, other: Optional<U, L, Bounded>, ) -> Optional<T, L, Bounded>
Sourcepub fn ir_node_named(self, name: &str) -> Singleton<T, L, B>
pub fn ir_node_named(self, name: &str) -> Singleton<T, L, B>
An operator which allows you to “name” a HydroNode
.
This is only used for testing, to correlate certain HydroNode
s with IDs.
Source§impl<'a, T, L, B: Boundedness> Singleton<T, Atomic<L>, B>
impl<'a, T, L, B: Boundedness> Singleton<T, Atomic<L>, B>
Sourcepub fn snapshot(self, _nondet: NonDet) -> Singleton<T, Tick<L>, Bounded>
pub fn snapshot(self, _nondet: NonDet) -> Singleton<T, Tick<L>, Bounded>
Returns a singleton value corresponding to the latest snapshot of the singleton
being atomically processed. The snapshot at tick t + 1
is guaranteed to include
at least all relevant data that contributed to the snapshot at tick t
.
§Non-Determinism
Because this picks a snapshot of a singleton whose value is continuously changing, the output singleton has a non-deterministic value since the snapshot can be at an arbitrary point in time.
pub fn end_atomic(self) -> Optional<T, L, B>
Source§impl<'a, T, L, B: Boundedness> Singleton<T, L, B>
impl<'a, T, L, B: Boundedness> Singleton<T, L, B>
pub fn atomic(self, tick: &Tick<L>) -> Singleton<T, Atomic<L>, B>
Sourcepub fn snapshot(
self,
tick: &Tick<L>,
nondet: NonDet,
) -> Singleton<T, Tick<L>, Bounded>where
L: NoTick,
pub fn snapshot(
self,
tick: &Tick<L>,
nondet: NonDet,
) -> Singleton<T, Tick<L>, Bounded>where
L: NoTick,
Given a tick, returns a singleton value corresponding to a snapshot of the singleton
as of that tick. The snapshot at tick t + 1
is guaranteed to include at least all
relevant data that contributed to the snapshot at tick t
.
§Non-Determinism
Because this picks a snapshot of a singleton whose value is continuously changing, the output singleton has a non-deterministic value since the snapshot can be at an arbitrary point in time.
Sourcepub fn sample_eager(
self,
nondet: NonDet,
) -> Stream<T, L, Unbounded, TotalOrder, AtLeastOnce>
pub fn sample_eager( self, nondet: NonDet, ) -> Stream<T, L, Unbounded, TotalOrder, AtLeastOnce>
Eagerly samples the singleton as fast as possible, returning a stream of snapshots with order corresponding to increasing prefixes of data contributing to the singleton.
§Non-Determinism
At runtime, the singleton will be arbitrarily sampled as fast as possible, but due to non-deterministic batching and arrival of inputs, the output stream is non-deterministic.
Sourcepub fn sample_every(
self,
interval: impl QuotedWithContext<'a, Duration, L> + Copy + 'a,
nondet: NonDet,
) -> Stream<T, L, Unbounded, TotalOrder, AtLeastOnce>
pub fn sample_every( self, interval: impl QuotedWithContext<'a, Duration, L> + Copy + 'a, nondet: NonDet, ) -> Stream<T, L, Unbounded, TotalOrder, AtLeastOnce>
Given a time interval, returns a stream corresponding to snapshots of the singleton
value taken at various points in time. Because the input singleton may be
Unbounded
, there are no guarantees on what these snapshots are other than they
represent the value of the singleton given some prefix of the streams leading up to
it.
§Non-Determinism
The output stream is non-deterministic in which elements are sampled, since this is controlled by a clock.
Source§impl<'a, T, L> Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
impl<'a, T, L> Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
pub fn all_ticks(self) -> Stream<T, L, Unbounded, TotalOrder, ExactlyOnce>
pub fn all_ticks_atomic( self, ) -> Stream<T, Atomic<L>, Unbounded, TotalOrder, ExactlyOnce>
pub fn latest(self) -> Singleton<T, L, Unbounded>
pub fn latest_atomic(self) -> Singleton<T, Atomic<L>, Unbounded>
pub fn defer_tick(self) -> Singleton<T, Tick<L>, Bounded>
pub fn persist(self) -> Stream<T, Tick<L>, Bounded, TotalOrder, ExactlyOnce>
pub fn delta(self) -> Optional<T, Tick<L>, Bounded>
pub fn into_stream(self) -> Stream<T, Tick<L>, Bounded, TotalOrder, ExactlyOnce>
Trait Implementations§
Source§impl<'a, T, L, B: Boundedness> Clone for Singleton<T, L, B>
impl<'a, T, L, B: Boundedness> Clone for Singleton<T, L, B>
Source§impl<'a, T, L, B: Boundedness> CycleCollection<'a, ForwardRefMarker> for Singleton<T, L, B>
impl<'a, T, L, B: Boundedness> CycleCollection<'a, ForwardRefMarker> for Singleton<T, L, B>
Source§impl<'a, T, L> CycleCollection<'a, ForwardRefMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
impl<'a, T, L> CycleCollection<'a, ForwardRefMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
Source§impl<'a, T, L> CycleCollectionWithInitial<'a, TickCycleMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
impl<'a, T, L> CycleCollectionWithInitial<'a, TickCycleMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
Source§impl<'a, T, L, B: Boundedness> CycleComplete<'a, ForwardRefMarker> for Singleton<T, L, B>
impl<'a, T, L, B: Boundedness> CycleComplete<'a, ForwardRefMarker> for Singleton<T, L, B>
fn complete(self, ident: Ident, expected_location: LocationId)
Source§impl<'a, T, L> CycleComplete<'a, ForwardRefMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
impl<'a, T, L> CycleComplete<'a, ForwardRefMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
fn complete(self, ident: Ident, expected_location: LocationId)
Source§impl<'a, T, L> CycleComplete<'a, TickCycleMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
impl<'a, T, L> CycleComplete<'a, TickCycleMarker> for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
fn complete(self, ident: Ident, expected_location: LocationId)
Source§impl<'a, T, L> DeferTick for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
impl<'a, T, L> DeferTick for Singleton<T, Tick<L>, Bounded>where
L: Location<'a>,
fn defer_tick(self) -> Self
Source§impl<'a, T, L, B: Boundedness> From<Singleton<T, L, B>> for Optional<T, L, B>where
L: Location<'a>,
impl<'a, T, L, B: Boundedness> From<Singleton<T, L, B>> for Optional<T, L, B>where
L: Location<'a>,
Source§impl<'a, T, L> From<Singleton<T, L, Bounded>> for Singleton<T, L, Unbounded>where
L: Location<'a>,
impl<'a, T, L> From<Singleton<T, L, Bounded>> for Singleton<T, L, Unbounded>where
L: Location<'a>,
Source§impl<'a, T, U, L, B: Boundedness> ZipResult<'a, Optional<U, Tick<L>, B>> for Singleton<T, Tick<L>, B>
impl<'a, T, U, L, B: Boundedness> ZipResult<'a, Optional<U, Tick<L>, B>> for Singleton<T, Tick<L>, B>
type Out = Optional<(T, U), Tick<L>, B>
type ElementType = (T, U)
type Location = Tick<L>
fn other_location(other: &Optional<U, Tick<L>, B>) -> Tick<L>
fn other_ir_node(other: Optional<U, Tick<L>, B>) -> HydroNode
fn make(location: Tick<L>, ir_node: HydroNode) -> Self::Out
Source§impl<'a, T, U, L, B: Boundedness> ZipResult<'a, Singleton<U, Tick<L>, B>> for Singleton<T, Tick<L>, B>
impl<'a, T, U, L, B: Boundedness> ZipResult<'a, Singleton<U, Tick<L>, B>> for Singleton<T, Tick<L>, B>
type Out = Singleton<(T, U), Tick<L>, B>
type ElementType = (T, U)
type Location = Tick<L>
fn other_location(other: &Singleton<U, Tick<L>, B>) -> Tick<L>
fn other_ir_node(other: Singleton<U, Tick<L>, B>) -> HydroNode
fn make(location: Tick<L>, ir_node: HydroNode) -> Self::Out
Auto Trait Implementations§
impl<Type, Loc, Bound> !Freeze for Singleton<Type, Loc, Bound>
impl<Type, Loc, Bound> !RefUnwindSafe for Singleton<Type, Loc, Bound>
impl<Type, Loc, Bound> !Send for Singleton<Type, Loc, Bound>
impl<Type, Loc, Bound> !Sync for Singleton<Type, Loc, Bound>
impl<Type, Loc, Bound> Unpin for Singleton<Type, Loc, Bound>
impl<Type, Loc, Bound> !UnwindSafe for Singleton<Type, Loc, Bound>
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
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>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
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>
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 more