pub struct HoldingIndex { /* private fields */ }Expand description
A grow-only index of which nodes hold which content ids.
Content never mutates, so a holder fact is monotonic: it is either useful or stale because the holder is unreachable. Merge is set union, giving the index convergence without coordination or consensus. A stale announcement degrades to a peer miss and the fabric continues to any other holder.
Implementations§
Source§impl HoldingIndex
impl HoldingIndex
Sourcepub fn announce(&self, fact: HeldContent) -> Result<()>
pub fn announce(&self, fact: HeldContent) -> Result<()>
Announces that fact.holder holds fact.key.
Re-announcing the same fact is idempotent.
Sourcepub fn holders_of(&self, key: &ContentKey) -> Vec<Symbol>
pub fn holders_of(&self, key: &ContentKey) -> Vec<Symbol>
Returns holders announced for key, sorted by symbol order.
Sourcepub fn merge(&self, other: &HoldingIndex) -> Result<()>
pub fn merge(&self, other: &HoldingIndex) -> Result<()>
Merges all facts from other by grow-only set union.
Trait Implementations§
Source§impl Default for HoldingIndex
impl Default for HoldingIndex
Source§fn default() -> HoldingIndex
fn default() -> HoldingIndex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for HoldingIndex
impl RefUnwindSafe for HoldingIndex
impl Send for HoldingIndex
impl Sync for HoldingIndex
impl Unpin for HoldingIndex
impl UnsafeUnpin for HoldingIndex
impl UnwindSafe for HoldingIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more