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>
impl<'a> BackupNode<'a>
Sourcepub fn new(
gateway: &'a dyn GatewayApi,
deploy: &'a dyn DeployApi,
reader: Option<&'a dyn TreeReader>,
) -> Self
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).
Sourcepub fn has_files(&self) -> bool
pub fn has_files(&self) -> bool
Whether the backup’s files can be read (it declares a transport).
Sourcepub async fn status(&self) -> Result<RedundancyStatusWire, CoreError>
pub async fn status(&self) -> Result<RedundancyStatusWire, CoreError>
The backup’s own redundancy status.
Sourcepub async fn deployment_mode(&self) -> Result<Option<String>, CoreError>
pub async fn deployment_mode(&self) -> Result<Option<String>, CoreError>
The backup’s active deployment mode, normalized (None is no mode).
Sourcepub async fn read_back(
&self,
expected: &Expected,
) -> Result<BTreeMap<String, Remote>, CoreError>
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).
Sourcepub async fn read_files(
&self,
scope: &Scope,
) -> Option<Result<ObservedFiles, CoreError>>
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).
Sourcepub async fn secret_names(
&self,
provider: &str,
) -> Result<SecretNameListing, CoreError>
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.
Sourcepub async fn sync_exhausted(&self, since_ms: i64) -> Result<bool, CoreError>
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.