pub struct AgentTreeView {
pub agent_id: String,
pub pid: Pid,
pub scope: TreeScope,
}Expand description
A filtered view of the resource tree scoped to an agent’s capabilities.
All path operations pass through the view’s authorization filter.
Unauthorized access returns KernelError::CapabilityDenied.
Fields§
§agent_id: StringAgent identifier.
pid: PidAgent’s PID.
scope: TreeScopeTree scope defining allowed paths.
Implementations§
Source§impl AgentTreeView
impl AgentTreeView
Sourcepub fn new(agent_id: String, pid: Pid, scope: TreeScope) -> Self
pub fn new(agent_id: String, pid: Pid, scope: TreeScope) -> Self
Create a new tree view for an agent.
Sourcepub fn full_access(agent_id: String, pid: Pid) -> Self
pub fn full_access(agent_id: String, pid: Pid) -> Self
Create a full-access tree view.
Sourcepub fn restricted(agent_id: String, pid: Pid) -> Self
pub fn restricted(agent_id: String, pid: Pid) -> Self
Create a restricted tree view for an agent.
Sourcepub fn namespace_scoped(
agent_id: String,
pid: Pid,
namespaces: Vec<String>,
) -> Self
pub fn namespace_scoped( agent_id: String, pid: Pid, namespaces: Vec<String>, ) -> Self
Create a namespace-scoped tree view.
Sourcepub fn assert_read(&self, path: &str) -> Result<(), KernelError>
pub fn assert_read(&self, path: &str) -> Result<(), KernelError>
Assert read access or return a permission error.
Sourcepub fn assert_write(&self, path: &str) -> Result<(), KernelError>
pub fn assert_write(&self, path: &str) -> Result<(), KernelError>
Assert write access or return a permission error.
Auto Trait Implementations§
impl Freeze for AgentTreeView
impl RefUnwindSafe for AgentTreeView
impl Send for AgentTreeView
impl Sync for AgentTreeView
impl Unpin for AgentTreeView
impl UnsafeUnpin for AgentTreeView
impl UnwindSafe for AgentTreeView
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more