Skip to main content

Lockdown

Struct Lockdown 

Source
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: LockdownRestrictions

The named restrictions.

§expires_at_ms: u64

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

§newcomer_window_ms: u64

newcomer_window_s in ms: restrict_newcomers covers members admitted this recently.

Implementations§

Source§

impl Lockdown

Source

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

Whether the lockdown is in force at now_ms.

Source

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).

Source

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).

Source

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§

Source§

impl Clone for Lockdown

Source§

fn clone(&self) -> Lockdown

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Lockdown

Source§

impl Debug for Lockdown

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Lockdown

Source§

impl PartialEq for Lockdown

Source§

fn eq(&self, other: &Lockdown) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Lockdown

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.