Skip to content

Commit e137ae5

Browse files
authored
Merge pull request #77 from earthstar-project/get_payload
Add get_payload to Store trait
2 parents 4618893 + 1bb7fdc commit e137ae5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

data-model/src/store.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,13 +508,19 @@ where
508508
/// Forces persistence of all previous mutations
509509
fn flush() -> impl Future<Output = Result<(), Self::FlushError>>;
510510

511+
/// Returns a [`ufotofu::Producer`] of bytes for the payload corresponding to the given [`PayloadDigest`], if held.
512+
fn payload(
513+
&self,
514+
payload_digest: &PD,
515+
) -> impl Future<Output = Option<impl Producer<Item = u8>>>;
516+
511517
/// Returns a [`LengthyAuthorisedEntry`] with the given [`Path`] and [subspace](https://willowprotocol.org/specs/data-model/index.html#subspace) ID, if present.
512518
fn entry(
513519
&self,
514520
path: &Path<MCL, MCC, MPL>,
515521
subspace_id: &S,
516522
ignore: Option<QueryIgnoreParams>,
517-
) -> impl Future<Output = LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>;
523+
) -> impl Future<Output = Option<LengthyAuthorisedEntry<MCL, MCC, MPL, N, S, PD, AT>>>;
518524

519525
/// Queries which entries are [included](https://willowprotocol.org/specs/grouping-entries/index.html#area_include) by an [`AreaOfInterest`], returning a producer of [`LengthyAuthorisedEntry`].
520526
fn query_area(

0 commit comments

Comments
 (0)