pub struct ObjectRef {
pub kind: String,
pub id: String,
}Expand description
A subject or protected object: a type and an id, written type:id.
Both halves may be the wildcard *. The type is everything before the
first :, so ids may themselves contain colons (user:oidc:alice).
Fields§
§kind: StringObject type, e.g. database, group, tenant, user.
id: StringId within the type, or WILDCARD.
Implementations§
Source§impl ObjectRef
impl ObjectRef
Sourcepub fn new(kind: impl Into<String>, id: impl Into<String>) -> Self
pub fn new(kind: impl Into<String>, id: impl Into<String>) -> Self
Builds a reference from its parts.
Sourcepub fn parse(text: &str) -> Self
pub fn parse(text: &str) -> Self
Parses type:id. A string with no : is read as an id of type
user, the common case in hand-written policy.
Sourcepub fn wildcard_of_type(&self) -> Self
pub fn wildcard_of_type(&self) -> Self
Every object of this reference’s type: type:*.
Sourcepub fn is_wildcard(&self) -> bool
pub fn is_wildcard(&self) -> bool
Whether this reference names every object of its type.
Trait Implementations§
impl Eq for ObjectRef
Source§impl Ord for ObjectRef
impl Ord for ObjectRef
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for ObjectRef
impl PartialOrd for ObjectRef
impl StructuralPartialEq for ObjectRef
Auto Trait Implementations§
impl Freeze for ObjectRef
impl RefUnwindSafe for ObjectRef
impl Send for ObjectRef
impl Sync for ObjectRef
impl Unpin for ObjectRef
impl UnsafeUnpin for ObjectRef
impl UnwindSafe for ObjectRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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>
Wrap the input message
T in a tonic::Request