Trait hydro_lang::location::Location
source · pub trait Location<'a>: Clone {
type Root: Location<'a>;
// Required methods
fn root(&self) -> Self::Root;
fn id(&self) -> LocationId;
fn flow_state(&self) -> &FlowState;
fn is_top_level() -> bool;
// Provided methods
fn tick(&self) -> Tick<Self>
where Self: NoTick { ... }
fn spin(&self) -> Stream<(), Self, Unbounded>
where Self: Sized + NoTick { ... }
fn source_stream<T, E: FuturesStream<Item = T> + Unpin>(
&self,
e: impl QuotedWithContext<'a, E, Self>,
) -> Stream<T, Self, Unbounded>
where Self: Sized + NoTick { ... }
fn source_iter<T, E: IntoIterator<Item = T>>(
&self,
e: impl QuotedWithContext<'a, E, Self>,
) -> Stream<T, Self, Unbounded>
where Self: Sized + NoTick { ... }
fn singleton<T: Clone>(
&self,
e: impl QuotedWithContext<'a, T, Self>,
) -> Singleton<T, Self, Unbounded>
where Self: Sized + NoTick { ... }
unsafe fn source_interval(
&self,
interval: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a,
) -> Stream<Instant, Self, Unbounded>
where Self: Sized + NoTick { ... }
unsafe fn source_interval_delayed(
&self,
delay: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a,
interval: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a,
) -> Stream<Instant, Self, Unbounded>
where Self: Sized + NoTick { ... }
fn forward_ref<S: CycleCollection<'a, ForwardRefMarker, Location = Self>>(
&self,
) -> (ForwardRef<'a, S>, S)
where Self: NoTick { ... }
}
Required Associated Types§
Required Methods§
fn root(&self) -> Self::Root
fn id(&self) -> LocationId
fn flow_state(&self) -> &FlowState
fn is_top_level() -> bool
Provided Methods§
fn tick(&self) -> Tick<Self>where
Self: NoTick,
fn spin(&self) -> Stream<(), Self, Unbounded>
fn source_stream<T, E: FuturesStream<Item = T> + Unpin>( &self, e: impl QuotedWithContext<'a, E, Self>, ) -> Stream<T, Self, Unbounded>
fn source_iter<T, E: IntoIterator<Item = T>>( &self, e: impl QuotedWithContext<'a, E, Self>, ) -> Stream<T, Self, Unbounded>
fn singleton<T: Clone>( &self, e: impl QuotedWithContext<'a, T, Self>, ) -> Singleton<T, Self, Unbounded>
sourceunsafe fn source_interval(
&self,
interval: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a,
) -> Stream<Instant, Self, Unbounded>
unsafe fn source_interval( &self, interval: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a, ) -> Stream<Instant, Self, Unbounded>
Generates a stream with values emitted at a fixed interval, with
each value being the current time (as an [tokio::time::Instant
]).
The clock source used is monotonic, so elements will be emitted in increasing order.
§Safety
Because this stream is generated by an OS timer, it will be non-deterministic because each timestamp will be arbitrary.
sourceunsafe fn source_interval_delayed(
&self,
delay: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a,
interval: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a,
) -> Stream<Instant, Self, Unbounded>
unsafe fn source_interval_delayed( &self, delay: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a, interval: impl QuotedWithContext<'a, Duration, Self> + Copy + 'a, ) -> Stream<Instant, Self, Unbounded>
Generates a stream with values emitted at a fixed interval (with an
initial delay), with each value being the current time
(as an [tokio::time::Instant
]).
The clock source used is monotonic, so elements will be emitted in increasing order.
§Safety
Because this stream is generated by an OS timer, it will be non-deterministic because each timestamp will be arbitrary.
fn forward_ref<S: CycleCollection<'a, ForwardRefMarker, Location = Self>>(
&self,
) -> (ForwardRef<'a, S>, S)where
Self: NoTick,
Object Safety§
This trait is not object safe.