Struct Pulled
#[non_exhaustive]pub struct Pulled<R> {
pub batch: PushBatch,
pub resume: R,
pub waiting: Waiting,
pub responder: Option<StoreId>,
}Expand description
What one pull returned.
A named struct rather than (PushBatch, R, Waiting) because each field is
worth naming at the call site, and a tuple of a batch and a token invites
exactly the transposition it cannot catch.
new says Waiting::Unknown and names no responder, neither a lie;
with_waiting and with_responder say more.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.batch: PushBatchThe events, in the far side’s forwarding order.
resume: RWhere to resume the next pull from.
waiting: WaitingWhat the far side still holds past resume (SY-37). After the two
fields above: postcard is positional, and they keep their places.
responder: Option<StoreId>The store incarnation that answered, if the far side has one (ADR-0104). Declared last.
Implementations§
§impl<R> Pulled<R>
impl<R> Pulled<R>
pub const fn new(batch: PushBatch, resume: R) -> Self
pub const fn new(batch: PushBatch, resume: R) -> Self
Pairs a batch with the token that follows it, saying
Waiting::Unknown and naming no responder.
pub const fn with_waiting(self, waiting: Waiting) -> Self
pub const fn with_waiting(self, waiting: Waiting) -> Self
Says what the far side still holds past resume.
A builder step rather than a third argument to new, so a
peer that cannot tell keeps calling new and says
Waiting::Unknown, which is never a lie.
pub const fn with_responder(self, responder: StoreId) -> Self
pub const fn with_responder(self, responder: StoreId) -> Self
Names the store incarnation that answered this pull (ADR-0104).
A peer that answers from a store of its own — a
StoreSyncPeer — says which, so a runner that
sees the name change between two answers on one relationship knows the
far side was restored or re-minted under a new
StoreId (VT-6). A peer with no store of its own keeps calling
new, and says nothing rather than something false.