Skip to main content

Pulled

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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§batch: PushBatch

The events, in the far side’s forwarding order.

§resume: R

Where to resume the next pull from.

§waiting: Waiting

What 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>

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

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

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.

Trait Implementations§

§

impl<R: Clone> Clone for Pulled<R>

§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<R: Debug> Debug for Pulled<R>

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
§

impl<'de, R> Deserialize<'de> for Pulled<R>
where R: Deserialize<'de>,

§

fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>

Deserialize this value from the given Serde deserializer. Read more
§

impl<R: Eq> Eq for Pulled<R>

§

impl<R: PartialEq> PartialEq for Pulled<R>

§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
§

impl<R> Serialize for Pulled<R>
where R: Serialize,

§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
§

impl<R: PartialEq> StructuralPartialEq for Pulled<R>

Auto Trait Implementations§

§

impl<R> Freeze for Pulled<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for Pulled<R>
where R: RefUnwindSafe,

§

impl<R> Send for Pulled<R>
where R: Send,

§

impl<R> Sync for Pulled<R>
where R: Sync,

§

impl<R> Unpin for Pulled<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for Pulled<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for Pulled<R>
where R: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.