pub enum MaxPrivilege {
Standard,
Elevated,
}Expand description
Maximum privilege level a channel can operate at.
This is a static capability bound, not a runtime state.
Even if a Session is elevated, a channel with MaxPrivilege::Standard
cannot perform elevated operations.
§Inheritance
When spawning child channels:
- Child’s
max_privilegeis capped by parent’smax_privilege - A Standard parent cannot spawn an Elevated child
§Example
use orcs_runtime::MaxPrivilege;
let elevated = MaxPrivilege::Elevated;
let standard = MaxPrivilege::Standard;
// Elevated > Standard
assert!(elevated > standard);
// min() for inheritance
assert_eq!(elevated.min(standard), standard);Variants§
Standard
Can only perform standard operations.
Cannot:
- Send global signals
- Perform destructive file/git operations
Elevated
Can perform elevated operations (if Session is also elevated).
This is the maximum capability - actual permission still requires an elevated Session at runtime.
Implementations§
Source§impl MaxPrivilege
impl MaxPrivilege
Sourcepub fn min(self, other: Self) -> Self
pub fn min(self, other: Self) -> Self
Returns the minimum of two privilege levels.
Used for privilege inheritance: child = parent.min(requested).
Sourcepub fn is_elevated(self) -> bool
pub fn is_elevated(self) -> bool
Returns true if this is the Elevated level.
Sourcepub fn is_standard(self) -> bool
pub fn is_standard(self) -> bool
Returns true if this is the Standard level.
Trait Implementations§
Source§impl Clone for MaxPrivilege
impl Clone for MaxPrivilege
Source§fn clone(&self) -> MaxPrivilege
fn clone(&self) -> MaxPrivilege
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MaxPrivilege
impl Debug for MaxPrivilege
Source§impl Default for MaxPrivilege
impl Default for MaxPrivilege
Source§fn default() -> MaxPrivilege
fn default() -> MaxPrivilege
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for MaxPrivilege
impl<'de> Deserialize<'de> for MaxPrivilege
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 Hash for MaxPrivilege
impl Hash for MaxPrivilege
Source§impl Ord for MaxPrivilege
impl Ord for MaxPrivilege
Source§fn cmp(&self, other: &MaxPrivilege) -> Ordering
fn cmp(&self, other: &MaxPrivilege) -> Ordering
1.21.0 · 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 PartialEq for MaxPrivilege
impl PartialEq for MaxPrivilege
Source§impl PartialOrd for MaxPrivilege
impl PartialOrd for MaxPrivilege
Source§impl Serialize for MaxPrivilege
impl Serialize for MaxPrivilege
impl Copy for MaxPrivilege
impl Eq for MaxPrivilege
impl StructuralPartialEq for MaxPrivilege
Auto Trait Implementations§
impl Freeze for MaxPrivilege
impl RefUnwindSafe for MaxPrivilege
impl Send for MaxPrivilege
impl Sync for MaxPrivilege
impl Unpin for MaxPrivilege
impl UnsafeUnpin for MaxPrivilege
impl UnwindSafe for MaxPrivilege
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.