Skip to content

Struct permissions::Lockdown

zaun_community_protocol::permissions::Lockdown · Struct

pub struct Lockdown { … }

The community’s lockdown row.

The named restrictions.

Expiry in ms since the epoch; the lockdown is active while now < expires_at_ms.

newcomer_window_s in ms: restrict_newcomers covers members admitted this recently.

pub const fn is_active(&self, now_ms: u64) -> bool

Whether the lockdown is in force at now_ms.

pub const fn limits_expensive(&self, is_owner: bool, now_ms: u64) -> bool

Whether restrict_expensive binds a member at now_ms: the lockdown is in force, names it, and the member is not the owner (the only exemption, ADR-0016).

pub fn max_mask(restrictions: LockdownRestrictions, newcomers: Permissions) -> Permissions

The whole permission mask the lockdown can remove from anyone, given the policy’s newcomer mask. H3 checks a lockdown enable against this (permissions the protocol).

pub fn mask_for(&self, admitted_at_ms: u64, newcomers: Permissions, now_ms: u64) -> Permissions

The mask for one member admitted at admitted_at_ms; empty once expired.

Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

Full rustdoc page