Skip to main content

PullReply

Enum PullReply 

Source
pub enum PullReply {
    NothingNew {
        epoch: String,
        version: u64,
    },
    Changes {
        epoch: String,
        version: u64,
        upserts: Vec<Row>,
        deletes: Vec<String>,
        more: bool,
    },
    FullCopy {
        epoch: String,
        version: u64,
        rows: Vec<Row>,
        next: Option<String>,
        head: Option<u64>,
    },
}
Expand description

An app’s answer to one pull (section 4.2).

Variants§

§

NothingNew

{"e":"k3f9a2c1","v":41}

Fields

§epoch: String

The ledger’s epoch.

§version: u64

The ledger’s head, which the caller already holds.

§

Changes

{"e":…,"v":43,"u":[…],"x":[…]} plus "m":1 when more remain.

Fields

§epoch: String

The ledger’s epoch, the caller’s too.

§version: u64

The version the caller holds once it applied these changes: the head, or, when cut (more), the version just before the first change whose earlier value the ledger no longer knows.

§upserts: Vec<Row>

Rows added or changed, in version order.

§deletes: Vec<String>

Keys deleted.

§more: bool

More changes remain: ask again from version.

§

FullCopy

{"e":…,"v":7,"f":1,"u":[…]} plus "n":"<last key>" when more pages remain, and "h" on a later page read after the head moved. Rows are in key order.

Fields

§epoch: String

The epoch the copy is in.

§version: u64

The copy’s version: the head when page one was read. Every page of one copy carries it, and the caller asks for the changes since it once the last page is in.

§rows: Vec<Row>

The rows of this page, as they are when it is read.

§next: Option<String>

The last key of this page when more pages remain.

§head: Option<u64>

"h", for the node only: the head when a later page was read, when it is above version. The page’s rows can be that new, so the node raises its mark for the epoch to it; it is not passed to the device.

Implementations§

Source§

impl PullReply

Source

pub fn epoch(&self) -> &str

The reply’s epoch.

Source

pub fn version(&self) -> u64

The version the caller holds once it applied the reply (for a full copy, once its last page is in).

Source

pub fn handed_out(&self) -> u64

The highest version whose data the reply can carry: version, or "h" on a later page of a full copy. The node keeps, per epoch, the highest of these it has passed on, and answers an announce below it with rotate.

Source

pub fn is_truncated(&self) -> bool

True when the caller must ask again to get the rest ("m":1 or "n"). The node records a reply’s head only when this is false.

Trait Implementations§

Source§

impl Clone for PullReply

Source§

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
Source§

impl Debug for PullReply

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PullReply

Source§

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

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

impl From<PullReply> for SyncAnswer

Source§

fn from(reply: PullReply) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for PullReply

Source§

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
Source§

impl Serialize for PullReply

Source§

fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error>

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

impl StructuralPartialEq for PullReply

Auto Trait Implementations§

§

impl Forget for PullReply

§

impl Freeze for PullReply

§

impl Move for PullReply

§

impl RefUnwindSafe for PullReply

§

impl Send for PullReply
where RawVecInner: Send, NodeRef<Owned, String, Value, LeafOrInternal>: Send, BoxRaw<(String, Value)>: Send,

§

impl Sync for PullReply
where RawVecInner: Sync, NodeRef<Owned, String, Value, LeafOrInternal>: Sync, BoxRaw<(String, Value)>: Sync,

§

impl Unpin for PullReply
where *const u8 is !null: Unpin, *const LeafNode<String, Value> is !null: Unpin, Box<(String, Value)>: Unpin,

§

impl UnsafeUnpin for PullReply

§

impl UnwindSafe for PullReply
where RawVecInner: UnwindSafe, BTreeMap<String, Value>: 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> Same for T

Source§

type Output = T

Should always be Self
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.