pub enum ClientRole<R> {
Operator,
App(R),
}Expand description
Who a connection on the client listener is: the runtime’s operator, or one of the application’s own roles. The application’s decoder receives one with every request and decides what it may do.
There is no replication variant: the client listener refuses a replication key during the handshake, so no decoder ever sees one.
Exhaustive on purpose, not #[non_exhaustive]: that would force every
decoder to write a wildcard arm, and a wildcard in an access check is a
default grant that a role added later would inherit silently. A new
runtime role is a compile error in every decoder instead.
Variants§
Operator
The node’s administrator. Also opens the admin endpoint.
App(R)
One of the application’s own roles.
Implementations§
Source§impl<R> ClientRole<R>
impl<R> ClientRole<R>
Sourcepub fn is_operator(&self) -> bool
pub fn is_operator(&self) -> bool
Whether this is the runtime’s operator role.
Trait Implementations§
Source§impl<R: Clone> Clone for ClientRole<R>
impl<R: Clone> Clone for ClientRole<R>
impl<R: Copy> Copy for ClientRole<R>
Source§impl<R: Debug> Debug for ClientRole<R>
impl<R: Debug> Debug for ClientRole<R>
impl<R: Eq> Eq for ClientRole<R>
Source§impl<R: PartialEq> PartialEq for ClientRole<R>
impl<R: PartialEq> PartialEq for ClientRole<R>
impl<R: PartialEq> StructuralPartialEq for ClientRole<R>
Auto Trait Implementations§
impl<R> Freeze for ClientRole<R>where
R: Freeze,
impl<R> RefUnwindSafe for ClientRole<R>where
R: RefUnwindSafe,
impl<R> Send for ClientRole<R>where
R: Send,
impl<R> Sync for ClientRole<R>where
R: Sync,
impl<R> Unpin for ClientRole<R>where
R: Unpin,
impl<R> UnsafeUnpin for ClientRole<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for ClientRole<R>where
R: UnwindSafe,
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