Skip to main content

BackupNode

Struct BackupNode 

Source
pub struct BackupNode<'a> { /* private fields */ }
Expand description

The read-only handle on a pair’s backup node.

Built from the backup’s own gateway surface, its own deploy surface and, when the target gives the backup a file transport, the read half of that transport. See the module doc for why no method here writes.

Implementations§

Source§

impl<'a> BackupNode<'a>

Source

pub fn new( gateway: &'a dyn GatewayApi, deploy: &'a dyn DeployApi, reader: Option<&'a dyn TreeReader>, ) -> Self

A handle over the backup’s surfaces. reader is None for a backup that declares no file transport (REST only).

Source

pub fn has_files(&self) -> bool

Whether the backup’s files can be read (it declares a transport).

Source

pub async fn status(&self) -> Result<RedundancyStatusWire, CoreError>

The backup’s own redundancy status.

Source

pub async fn deployment_mode(&self) -> Result<Option<String>, CoreError>

The backup’s active deployment mode, normalized (None is no mode).

Source

pub async fn read_back( &self, expected: &Expected, ) -> Result<BTreeMap<String, Remote>, CoreError>

Each declared, comparable resource read from the backup’s REST effective view (the same read the master’s verify makes).

Source

pub async fn read_files( &self, scope: &Scope, ) -> Option<Result<ObservedFiles, CoreError>>

The backup’s live files within scope; None when the backup declares no file transport (a REST-only backup).

Source

pub async fn secret_names( &self, provider: &str, ) -> Result<SecretNameListing, CoreError>

The names a secret provider lists on the backup. Names only: the listing carries no value.

Source

pub async fn sync_exhausted(&self, since_ms: i64) -> Result<bool, CoreError>

Whether the backup’s log says the gateway gave up syncing at or after since_ms (D-10, K5 d, WR-01). The lines are matched in memory and dropped; only the answer leaves.

since_ms is the epoch-ms the engine took (see wall_clock_ms) just before this run’s commit, so a line from a previous deploy or a past recovery never ends this run’s wait. The bound is applied twice: as the log query’s startTime and again on each entry’s own timestamp, which is the gateway’s clock.

Clock assumption: since_ms comes from the CLI host’s clock and the entries from the gateway’s, so they must agree to within the age of the stale line (seconds to minutes for a real previous run). A gateway clock that runs behind the host by more than the time the sync takes to give up can hide a fresh line; that only costs the early exit, and the wait ends on its budget with the one resync as before.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for BackupNode<'a>

§

impl<'a> !UnwindSafe for BackupNode<'a>

§

impl<'a> Freeze for BackupNode<'a>

§

impl<'a> Send for BackupNode<'a>

§

impl<'a> Sync for BackupNode<'a>

§

impl<'a> Unpin for BackupNode<'a>

§

impl<'a> UnsafeUnpin for BackupNode<'a>

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