Skip to content

Commit

Permalink
Fix up merge
Browse files Browse the repository at this point in the history
  • Loading branch information
sgwilym committed Aug 28, 2024
1 parent 55b3b5d commit f628ccd
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions data-model/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,6 @@ where
fn flush() -> impl Future<Output = Result<(), Self::FlushError>>;

/// Return a [`LengthyAuthorisedEntry`] with the given [`Path`] and [subspace](https://willowprotocol.org/specs/data-model/index.html#subspace) ID, if present.
///
/// If `ignore_incomplete_payloads` is `true`, will return `None` if the entry's corresponding payload is incomplete, even if there is an entry present.
/// If `ignore_empty_payloads` is `true`, will return `None` if the entry's payload length is `0`, even if there is an entry present.
fn entry(
&self,
path: &Path<MCL, MCC, MPL>,
Expand All @@ -355,9 +352,6 @@ where
) -> impl Future<Output = LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>;

/// Query which entries are [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`AreaOfInterest`], returning a producer of [`LengthyAuthorisedEntry`].
///
/// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads.
/// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`.
fn query_area(
&self,
area: &AreaOfInterest<MCL, MCC, MPL, S>,
Expand All @@ -367,9 +361,6 @@ where
) -> impl Producer<Item = LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>;

/// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`AreaOfInterest`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function.
///
/// If `ignore_incomplete_payloads` is `true`, the producer will not produce entries with incomplete corresponding payloads.
/// If `ignore_empty_payloads` is `true`, the producer will not produce entries with a `payload_length` of `0`.
fn subscribe_area(
&self,
area: &AreaOfInterest<MCL, MCC, MPL, S>,
Expand Down
1 change: 1 addition & 0 deletions wgps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition = "2021"

[dependencies]
willow-data-model = { path = "../data-model", version = "0.1.0" }
ufotofu = { version = "0.4.2", features = ["std"] }

[lints]
workspace = true
31 changes: 18 additions & 13 deletions wgps/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use std::future::Future;

use ufotofu::local_nb::Producer;
use willow_data_model::{
grouping::{AreaOfInterest, Range3d},
AuthorisationToken, NamespaceId, PayloadDigest, ResumptionFailedError, Store, SubspaceId,
AuthorisationToken, LengthyAuthorisedEntry, NamespaceId, PayloadDigest, QueryIgnoreParams,
ResumptionFailedError, Store, StoreEvent, SubspaceId,
};

/// Options to specify how ranges should be partitioned.
Expand Down Expand Up @@ -41,9 +45,8 @@ where
&self,
range: &Range3d<MCL, MCC, MPL, S>,
will_sort: bool,
ignore_incomplete_payloads: bool,
ignore_empty_payloads: bool,
) -> Self::EntryProducer;
ignore: Option<QueryIgnoreParams>,
) -> impl Producer<Item = LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>;

/// Subscribe to events concerning entries [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`Range3d`], returning a producer of `StoreEvent`s which occurred since the moment of calling this function.
///
Expand All @@ -52,32 +55,34 @@ where
fn subscribe_range(
&self,
range: &Range3d<MCL, MCC, MPL, S>,
ignore_incomplete_payloads: bool,
ignore_empty_payloads: bool,
) -> Self::EventProducer;
ignore: Option<QueryIgnoreParams>,
) -> impl Producer<Item = StoreEvent<MCL, MCC, MPL, N, S, PD, AT>>;

/// Attempt to resume a subscription using a *progress ID* obtained from a previous subscription, or return an error if this store implementation is unable to resume the subscription.
fn resume_range_subscription(
&self,
progress_id: u64,
range: &Range3d<MCL, MCC, MPL, S>,
ignore_incomplete_payloads: bool,
ignore_empty_payloads: bool,
) -> Result<Self::EventProducer, ResumptionFailedError>;
ignore: Option<QueryIgnoreParams>,
) -> impl Future<
Output = impl Producer<
Item = Result<StoreEvent<MCL, MCC, MPL, N, S, PD, AT>, ResumptionFailedError>,
>,
>;

/// Summarise a [`Range3d`] as a [fingerprint](https://willowprotocol.org/specs/3d-range-based-set-reconciliation/index.html#d3rbsr_fp).
fn summarise(&self, range: Range3d<MCL, MCC, MPL, S>) -> FP;
fn summarise(&self, range: Range3d<MCL, MCC, MPL, S>) -> impl Future<Output = FP>;

/// Convert an [`AreaOfInterest`] to a concrete [`Range3d`] including all the entries the given [`AreaOfInterest`] would.
fn area_of_interest_to_range(
&self,
aoi: &AreaOfInterest<MCL, MCC, MPL, S>,
) -> Range3d<MCL, MCC, MPL, S>;
) -> impl Future<Output = Range3d<MCL, MCC, MPL, S>>;

/// Partition a [`Range3d`] into many parts, or return `None` if the given range cannot be split (for instance because the range only includes a single entry).
fn partition_range(
&self,
range: &Range3d<MCL, MCC, MPL, S>,
options: &PartitionOpts,
) -> Option<impl Iterator<Item = RangeSplit<MCL, MCC, MPL, S, FP>>>;
) -> impl Future<Output = Option<impl Iterator<Item = RangeSplit<MCL, MCC, MPL, S, FP>>>>;
}

0 comments on commit f628ccd

Please sign in to comment.