Skip to main content

AclAccess

Struct AclAccess 

Source
pub struct AclAccess<'a, C: Config, const N: usize, const S: usize, const T: usize> { /* private fields */ }
Expand description

An Acl as the AccessControl one interaction sees.

The trait asks “may this action have required on this path?” and takes no subject, because the subject is not a property of the path — it is a property of the session the action arrived on. So the subject is bound here, once, when the interaction is set up, and the trait’s question becomes answerable:

// Derived from the session (§6.6.6.3), never from anything the message claimed.
let subject = SubjectDescriptor::case(FabricIndex(1), NodeId(0x1234));
let access = AclAccess::new(acl, node, &subject);
// `access` is now what `Server::new` takes.

A path that is not concrete is denied. Every call the server makes passes a concrete one — a wildcard is expanded before it is checked — so this is unreachable in practice, and it fails closed rather than guessing which endpoint a caller meant.

Implementations§

Source§

impl<'a, C: Config, const N: usize, const S: usize, const T: usize> AclAccess<'a, C, N, S, T>

Source

pub const fn new( acl: &'a RefCell<Acl<C, N, S, T>>, node: Node<'a>, subject: &'a SubjectDescriptor, ) -> Self

Binds a list, a node and the subject of one interaction.

Trait Implementations§

Source§

impl<C: Config, const N: usize, const S: usize, const T: usize> AccessControl for AclAccess<'_, C, N, S, T>

Source§

fn allows(&self, path: &AttributePath, required: Privilege) -> Outcome

Whether the subject holds required over this path. Read more
Source§

impl<'a, C: Debug + Config, const N: usize, const S: usize, const T: usize> Debug for AclAccess<'a, C, N, S, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !RefUnwindSafe for AclAccess<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !Send for AclAccess<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !Sync for AclAccess<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> !UnwindSafe for AclAccess<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Forget for AclAccess<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Freeze for AclAccess<'a, C, N, S, T>
where &'a RefCell<Acl<C, N, S, T>>: Freeze,

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Move for AclAccess<'a, C, N, S, T>

§

impl<'a, C, const N: usize, const S: usize, const T: usize> Unpin for AclAccess<'a, C, N, S, T>
where &'a RefCell<Acl<C, N, S, T>>: Unpin,

§

impl<'a, C, const N: usize, const S: usize, const T: usize> UnsafeUnpin for AclAccess<'a, C, N, S, T>
where &'a RefCell<Acl<C, N, S, T>>: UnsafeUnpin,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.