pub struct Scope {
pub tenant: String,
pub user: String,
pub workspace: Option<String>,
pub branch: Option<String>,
pub session: Option<String>,
pub agent: Option<String>,
}Expand description
Scope IDs are opaque, host-assigned identities, NOT filesystem paths or ACLs. Every grant is an exact scope match; no prefix or wildcard matching occurs.
Fields§
§tenant: String§user: String§workspace: Option<String>§branch: Option<String>§session: Option<String>§agent: Option<String>Implementations§
Source§impl Scope
impl Scope
pub fn user(tenant: impl Into<String>, user: impl Into<String>) -> Self
pub fn workspace(&self, id: impl Into<String>) -> Self
pub fn branch(&self, id: impl Into<String>) -> Self
pub fn session(&self, id: impl Into<String>) -> Self
pub fn agent(&self, id: impl Into<String>) -> Self
pub fn key(&self) -> Result<String>
pub fn validate(&self) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Scope
impl<'de> Deserialize<'de> for Scope
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
impl Eq for Scope
Source§impl Ord for Scope
impl Ord for Scope
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Scope
impl PartialOrd for Scope
impl StructuralPartialEq for Scope
Auto Trait Implementations§
impl Forget for Scope
impl Freeze for Scope
impl Move for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnsafeUnpin for Scope
impl UnwindSafe for Scope
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