Skip to main content

ProtectCallback

Trait ProtectCallback 

Source
pub trait ProtectCallback:
    Send
    + Sync
    + 'static {
    // Required method
    fn protect(&self) -> Option<Vec<Key>>;
}
Expand description

A registered protect callback — ADR-005 §Marks 3’s protection source, consulted pre-sweep and at direct-delete arbitration.

Named design point — the callback shape: one sync verb returning the protection set or a failure to answer. None means the protection source could not answer, and every consumer of that answer takes the safe side (iroh’s ProtectOutcome::Abort conclusion, adopted): a sweep aborts with GcAbortCause::ProtectFailed, nothing deleted (ADR-012 §1: abort is report data); a direct delete refuses conservatively with Error::GcRefuse — nothing deleted either way. The verb is sync by the same discipline as LivenessSource (direct-delete arbitration runs it under the arbitration lock — quick, never blocking); mark-time consults run outside the lock and may be slower.

Required Methods§

Source

fn protect(&self) -> Option<Vec<Key>>

The externally-known-live keys, or None when the protection source failed to answer (abort/refuse semantics above).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§