pub struct Principal { /* private fields */ }Expand description
An authenticated caller and the namespaces it may read/write. "*" in a list
grants that access on every namespace.
Implementations§
Source§impl Principal
impl Principal
pub fn new( name: impl Into<String>, read: Vec<String>, write: Vec<String>, ) -> Self
Sourcepub fn open() -> Self
pub fn open() -> Self
The implicit full-access identity of open (disabled-auth) mode. Unlike a configured principal, it is not authenticated, so it does not stamp authorship — open mode leaves the daemon a transparent store.
pub fn name(&self) -> &str
Sourcepub fn is_authenticated(&self) -> bool
pub fn is_authenticated(&self) -> bool
Whether authorship should be stamped from this principal on writes.
Sourcepub fn is_admin(&self) -> bool
pub fn is_admin(&self) -> bool
Whether this principal is an admin: read and write on every
namespace ("*" in both lists). Operations whose damage is not confined
to one namespace’s readers and writers require it, such as purge
(gonzalo#203): purging a tombstone early resurrects the record later, on
another machine. Open mode’s implicit principal is an admin.
The author a delete stamps on its tombstone (ADR 0015, gonzalo#203): the
same rule as put_raw. A non-admin is always stamped from its token; an
admin (the replication credential) or open mode may name the deleter,
and otherwise an authenticated admin is stamped and open mode stamps none.
Trait Implementations§
impl Eq for Principal
impl StructuralPartialEq for Principal
Auto Trait Implementations§
impl Freeze for Principal
impl RefUnwindSafe for Principal
impl Send for Principal
impl Sync for Principal
impl Unpin for Principal
impl UnsafeUnpin for Principal
impl UnwindSafe for Principal
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request