pub struct PrincipalId(pub Uuid);Expand description
Identifier for a Principal (actor) in the ORCS system.
A Principal represents “who” is performing an action, separate from “what permission they have”. This separation enables:
- Dynamic privilege: Same principal can be Standard or Elevated
- Audit trails: Actions are attributed to identifiable actors
- Network identity: Principals are unique across distributed systems
§Principal vs Component
PrincipalId: Who is acting (human user, system process)ComponentId: What is acting (LLM, Tool, Plugin)
A Component may act on behalf of a Principal, but they are distinct concepts. A human user (Principal) may trigger an LLM Component, but the LLM Component itself is not the Principal.
§Example
use orcs_types::PrincipalId;
let user = PrincipalId::new();
let admin = PrincipalId::new();
assert_ne!(user, admin); // Different principals
println!("User: {}", user);Tuple Fields§
§0: UuidImplementations§
Source§impl PrincipalId
impl PrincipalId
Trait Implementations§
Source§impl Clone for PrincipalId
impl Clone for PrincipalId
Source§fn clone(&self) -> PrincipalId
fn clone(&self) -> PrincipalId
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 PrincipalId
impl Debug for PrincipalId
Source§impl Default for PrincipalId
impl Default for PrincipalId
Source§impl<'de> Deserialize<'de> for PrincipalId
impl<'de> Deserialize<'de> for PrincipalId
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 Display for PrincipalId
impl Display for PrincipalId
Source§impl Hash for PrincipalId
impl Hash for PrincipalId
Source§impl PartialEq for PrincipalId
impl PartialEq for PrincipalId
Source§impl Serialize for PrincipalId
impl Serialize for PrincipalId
impl Copy for PrincipalId
impl Eq for PrincipalId
impl StructuralPartialEq for PrincipalId
Auto Trait Implementations§
impl Freeze for PrincipalId
impl RefUnwindSafe for PrincipalId
impl Send for PrincipalId
impl Sync for PrincipalId
impl Unpin for PrincipalId
impl UnsafeUnpin for PrincipalId
impl UnwindSafe for PrincipalId
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