Skip to main content

Records

Struct Records 

Source
pub struct Records { /* private fields */ }
Expand description

The records of the sync role, in sync.sqlite beside its lock, encrypted under a key of the replica’s: who holds the role, what other programs ask it, and what it did.

Implementations§

Source§

impl Records

Source

pub fn holder(&self) -> Result<Option<HolderRecord>, NodeError>

Who holds the role, as it recorded, if any program does: a record that a program left as it ended, as by a crash or as an app quits, says nothing once its lock is free.

§Errors

Returns an error if the database cannot be read, or the lock’s file opened.

Source

pub fn ask(&self, replica: Option<EntityId>, at: u64) -> Result<i64, NodeError>

Asks the holder to sync with one replica, or with all it finds: returns the ask, whose answer Records::answered tells.

§Errors

Returns an error if the database cannot be written.

Source

pub fn round(&self) -> Result<Option<Round>, NodeError>

Where the round of checks under way stands, if one began (technical design: checking and repair).

§Errors

Returns an error if the database cannot be read.

Source

pub fn answered(&self, ask: i64) -> Result<Option<u64>, NodeError>

When the holder answered an ask, if it did: once the sync with those of the replicas asked for that it found on the network ended, whose records then say how it went.

§Errors

Returns an error if the database cannot be read.

Source

pub fn replicas(&self) -> Result<BTreeMap<EntityId, ReplicaRecord>, NodeError>

What the holder recorded of each other replica. Only a holder that runs knows which are on the network: once its lock is free, none is, whatever it left recorded.

§Errors

Returns an error if the database cannot be read, or the lock’s file opened.

Source

pub fn synced_since( &self, asked: u64, ) -> Result<BTreeMap<EntityId, ReplicaRecord>, NodeError>

What the holder recorded of each replica that it synced with at asked or later, by the wall clock, as in answer to an ask made then: a sync recorded before was not the one asked for.

§Errors

Returns an error if the database cannot be read.

Source

pub fn holds(&self, at: u64) -> Result<BTreeSet<Hash>, NodeError>

The sealed blobs that this replica holds for others at at, as it proved them.

§Errors

Returns an error if the database cannot be read.

Source

pub fn backup_folders( &self, ) -> Result<BTreeMap<EntityId, FoundBackup>, NodeError>

The person’s backups that the holder found on this computer: where it last found each, and when it last updated it here, or tried to.

§Errors

Returns an error if the database cannot be read.

Source

pub fn record_backup( &self, backup: EntityId, folder: &Path, updated: Option<(u64, usize)>, ) -> Result<(), NodeError>

Records where the holder found a backup, and, if it updated it now or tried to, when, and how many changes the replica kept then.

§Errors

Returns an error if the database cannot be written.

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

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

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more