pub enum User {
UserId(String),
Userset(Object, Relation),
}Expand description
Represents either a specific user ID or a reference to a userset (e.g., a group).
Variants§
UserId(String)
A specific user, identified by a unique string.
e.g., "10", "alice".
Userset(Object, Relation)
A set of users, identified by an object-relation pair.
e.g., group:eng#member
Implementations§
Source§impl User
impl User
Sourcepub fn validate(&self) -> Result<(), DomainError>
pub fn validate(&self) -> Result<(), DomainError>
Validates this subject reference.
§Errors
Returns DomainError when a direct user id or userset object/relation violates public
identifier grammar or byte limits.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for User
Available on crate feature serde only.
impl<'de> Deserialize<'de> for User
Available on crate feature
serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TryFrom<&User> for SubjectFilter
impl TryFrom<&User> for SubjectFilter
Source§impl TryFrom<&User> for SubjectRef
impl TryFrom<&User> for SubjectRef
impl Eq for User
impl StructuralPartialEq for User
Auto Trait Implementations§
impl Freeze for User
impl RefUnwindSafe for User
impl Send for User
impl Sync for User
impl Unpin for User
impl UnsafeUnpin for User
impl UnwindSafe for User
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