pub struct Acl { /* private fields */ }Expand description
Which client may read which set (docs/design/VOLUME-TRUST.md §6.4). The handshake admits
every listed fingerprint; this decides, per request, whether the admitted client may read the
set it asks for. A set outside a client’s lists is answered like an unknown set.
Implementations§
Source§impl Acl
impl Acl
Sourcepub fn everyone() -> Acl
pub fn everyone() -> Acl
Every admitted connection may read every set (plain mode, --allow-anyone, and a plain
global allow list, where the handshake already decided).
Sourcepub fn new(
any_set: impl IntoIterator<Item = [u8; 32]>,
per_set: impl IntoIterator<Item = ([u8; 32], [u8; 32])>,
) -> Acl
pub fn new( any_set: impl IntoIterator<Item = [u8; 32]>, per_set: impl IntoIterator<Item = ([u8; 32], [u8; 32])>, ) -> Acl
any_set: fingerprints that may read every served set; per_set: (set id, fingerprint)
pairs for clients restricted to specific sets.
Sourcepub fn admitted(&self) -> Vec<[u8; 32]>
pub fn admitted(&self) -> Vec<[u8; 32]>
Every fingerprint the handshake must admit (the union of all lists).
Sourcepub fn restricted(&self) -> Vec<[u8; 32]>
pub fn restricted(&self) -> Vec<[u8; 32]>
Fingerprints that may read only some sets (none of them is in the global list).
Sourcepub fn readers_of(&self, set: &[u8; 32]) -> Option<usize>
pub fn readers_of(&self, set: &[u8; 32]) -> Option<usize>
How many identities may read set: None when everyone admitted may.
pub fn may_read(&self, client: Option<&[u8; 32]>, set: &[u8; 32]) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Acl
impl RefUnwindSafe for Acl
impl Send for Acl
impl Sync for Acl
impl Unpin for Acl
impl UnsafeUnpin for Acl
impl UnwindSafe for Acl
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DefaultBoxed for Twhere
T: Default,
impl<T> DefaultBoxed for Twhere
T: Default,
Source§unsafe fn default_in_place(ptr: *mut T)
unsafe fn default_in_place(ptr: *mut T)
Fill the given memory location with default value. Read more
Source§fn default_boxed() -> Box<Self>where
Self: Sized,
fn default_boxed() -> Box<Self>where
Self: Sized,
Create a boxed instance with default value for each field.
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more