pub trait DelegateInbox: Send + Sync {
// Required methods
fn persist(&self, address: &str, bytes: &[u8]) -> Result<()>;
fn load(&self, address: &str) -> Result<Option<Vec<u8>>>;
fn addresses(&self) -> Result<Vec<String>>;
fn remove(&self, address: &str) -> Result<()>;
fn quarantine(&self, address: &str, note: &Quarantine) -> Result<()>;
fn quarantined(&self) -> Result<Vec<(String, Quarantine)>>;
fn load_quarantined(&self, address: &str) -> Result<Option<Vec<u8>>>;
fn discard(&self, address: &str) -> Result<Option<Quarantine>>;
}Expand description
Where a delegate keeps the hand-offs it accepted until custody is confirmed. Never a library: a delegate copy is not an asset of the delegate’s.
A copy is either held (listed by addresses and uploaded on every
run) or quarantined (kept byte for byte with its Quarantine note, never retried, and
deleted only by discard).
Required Methods§
Sourcefn persist(&self, address: &str, bytes: &[u8]) -> Result<()>
fn persist(&self, address: &str, bytes: &[u8]) -> Result<()>
Persist bytes under address durably — written and synced, its directory entry
too — before returning. An acknowledgement follows only after this returns.
Sourcefn remove(&self, address: &str) -> Result<()>
fn remove(&self, address: &str) -> Result<()>
Delete the copy under address. Removing an absent one is not an error.
Sourcefn quarantine(&self, address: &str, note: &Quarantine) -> Result<()>
fn quarantine(&self, address: &str, note: &Quarantine) -> Result<()>
Move the held copy under address to quarantine with note, durably, keeping its
bytes. Quarantining an absent copy is not an error.
Sourcefn quarantined(&self) -> Result<Vec<(String, Quarantine)>>
fn quarantined(&self) -> Result<Vec<(String, Quarantine)>>
Every quarantined copy’s address and note, each once.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".