pub struct Lockdown {
pub restrictions: LockdownRestrictions,
pub expires_at_ms: u64,
pub newcomer_window_ms: u64,
}Expand description
The community’s lockdown row (specification §8.10).
Fields§
§restrictions: LockdownRestrictionsThe named restrictions.
expires_at_ms: u64Expiry in ms since the epoch; the lockdown is active while now < expires_at_ms.
newcomer_window_ms: u64newcomer_window_s in ms: restrict_newcomers covers members admitted this recently.
Implementations§
Source§impl Lockdown
impl Lockdown
Sourcepub const fn limits_expensive(&self, is_owner: bool, now_ms: u64) -> bool
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).
Sourcepub fn max_mask(
restrictions: LockdownRestrictions,
newcomers: Permissions,
) -> Permissions
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 §4.6).
Sourcepub fn mask_for(
&self,
admitted_at_ms: u64,
newcomers: Permissions,
now_ms: u64,
) -> Permissions
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.
Trait Implementations§
impl Copy for Lockdown
impl Eq for Lockdown
impl StructuralPartialEq for Lockdown
Auto Trait Implementations§
impl Freeze for Lockdown
impl RefUnwindSafe for Lockdown
impl Send for Lockdown
impl Sync for Lockdown
impl Unpin for Lockdown
impl UnsafeUnpin for Lockdown
impl UnwindSafe for Lockdown
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