Skip to content

Commit

Permalink
refactor(hydroflow_plus)!: location type parameter before boundedness (
Browse files Browse the repository at this point in the history
…#1551)

When looking at a prefix in an IDE, the location type argument is
generally more useful.
  • Loading branch information
shadaj authored Nov 8, 2024
1 parent c7b5f32 commit 9107841
Show file tree
Hide file tree
Showing 9 changed files with 294 additions and 288 deletions.
4 changes: 2 additions & 2 deletions hydroflow_plus/src/location/external_process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ impl<'a, P> ExternalProcess<'a, P> {
pub fn source_external_bytes<L: Location<'a> + NoTick>(
&self,
to: &L,
) -> (ExternalBytesPort, Stream<Bytes, Unbounded, L>) {
) -> (ExternalBytesPort, Stream<Bytes, L, Unbounded>) {
let next_external_port_id = {
let mut flow_state = self.flow_state.borrow_mut();
let id = flow_state.next_external_out;
Expand Down Expand Up @@ -97,7 +97,7 @@ impl<'a, P> ExternalProcess<'a, P> {
pub fn source_external_bincode<L: Location<'a> + NoTick, T: Serialize + DeserializeOwned>(
&self,
to: &L,
) -> (ExternalBincodeSink<T>, Stream<T, Unbounded, L>) {
) -> (ExternalBincodeSink<T>, Stream<T, L, Unbounded>) {
let next_external_port_id = {
let mut flow_state = self.flow_state.borrow_mut();
let id = flow_state.next_external_out;
Expand Down
12 changes: 6 additions & 6 deletions hydroflow_plus/src/location/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub trait Location<'a>: Clone {
}
}

fn spin(&self) -> Stream<(), Unbounded, Self>
fn spin(&self) -> Stream<(), Self, Unbounded>
where
Self: Sized + NoTick,
{
Expand All @@ -94,7 +94,7 @@ pub trait Location<'a>: Clone {
fn source_stream<T, E: FuturesStream<Item = T> + Unpin>(
&self,
e: impl Quoted<'a, E>,
) -> Stream<T, Unbounded, Self>
) -> Stream<T, Self, Unbounded>
where
Self: Sized + NoTick,
{
Expand All @@ -112,7 +112,7 @@ pub trait Location<'a>: Clone {
fn source_iter<T, E: IntoIterator<Item = T>>(
&self,
e: impl Quoted<'a, E>,
) -> Stream<T, Unbounded, Self>
) -> Stream<T, Self, Unbounded>
where
Self: Sized + NoTick,
{
Expand All @@ -129,7 +129,7 @@ pub trait Location<'a>: Clone {
)
}

fn singleton<T: Clone>(&self, e: impl Quoted<'a, T>) -> Singleton<T, Unbounded, Self>
fn singleton<T: Clone>(&self, e: impl Quoted<'a, T>) -> Singleton<T, Self, Unbounded>
where
Self: Sized + NoTick,
{
Expand All @@ -156,7 +156,7 @@ pub trait Location<'a>: Clone {
fn source_interval(
&self,
interval: impl Quoted<'a, Duration> + Copy + 'a,
) -> Stream<tokio::time::Instant, Unbounded, Self>
) -> Stream<tokio::time::Instant, Self, Unbounded>
where
Self: Sized + NoTick,
{
Expand All @@ -169,7 +169,7 @@ pub trait Location<'a>: Clone {
&self,
delay: impl Quoted<'a, Duration> + Copy + 'a,
interval: impl Quoted<'a, Duration> + Copy + 'a,
) -> Stream<tokio::time::Instant, Unbounded, Self>
) -> Stream<tokio::time::Instant, Self, Unbounded>
where
Self: Sized + NoTick,
{
Expand Down
6 changes: 3 additions & 3 deletions hydroflow_plus/src/location/tick.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'a, L: Location<'a>> Tick<L> {
pub fn spin_batch(
&self,
batch_size: impl Quoted<'a, usize> + Copy + 'a,
) -> Stream<(), Bounded, Self>
) -> Stream<(), Self, Bounded>
where
L: NoTick,
{
Expand All @@ -56,7 +56,7 @@ impl<'a, L: Location<'a>> Tick<L> {
.tick_batch(self)
}

pub fn singleton<T: Clone>(&self, e: impl Quoted<'a, T>) -> Singleton<T, Bounded, Self>
pub fn singleton<T: Clone>(&self, e: impl Quoted<'a, T>) -> Singleton<T, Self, Bounded>
where
L: NoTick,
{
Expand All @@ -66,7 +66,7 @@ impl<'a, L: Location<'a>> Tick<L> {
pub fn singleton_first_tick<T: Clone>(
&self,
e: impl Quoted<'a, T>,
) -> Optional<T, Bounded, Self>
) -> Optional<T, Self, Bounded>
where
L: NoTick,
{
Expand Down
Loading

0 comments on commit 9107841

Please sign in to comment.