pub struct SpaceManager { /* private fields */ }Expand description
Manages the set of memory spaces.
Implementations§
Source§impl SpaceManager
impl SpaceManager
Sourcepub fn create_space(&mut self, name: &str, owner: AgentId) -> MemorySpace
pub fn create_space(&mut self, name: &str, owner: AgentId) -> MemorySpace
Create a new space owned by owner.
Sourcepub fn get_space(&self, id: SpaceId) -> Option<&MemorySpace>
pub fn get_space(&self, id: SpaceId) -> Option<&MemorySpace>
Returns a reference to the space with the given ID, if it exists.
Sourcepub fn delete_space(&mut self, id: SpaceId)
pub fn delete_space(&mut self, id: SpaceId)
Removes a space by ID.
Sourcepub fn grant_access(&mut self, space: SpaceId, agent: AgentId, perm: Permission)
pub fn grant_access(&mut self, space: SpaceId, agent: AgentId, perm: Permission)
Grant perm to agent in the given space.
Sourcepub fn revoke_access(&mut self, space: SpaceId, agent: AgentId)
pub fn revoke_access(&mut self, space: SpaceId, agent: AgentId)
Remove all access for agent in the given space.
Sourcepub fn check_access(
&self,
space: SpaceId,
agent: AgentId,
required: Permission,
) -> bool
pub fn check_access( &self, space: SpaceId, agent: AgentId, required: Permission, ) -> bool
Check whether agent has at least required permission in the space.
Sourcepub fn list_spaces_for_agent(&self, agent: AgentId) -> Vec<&MemorySpace>
pub fn list_spaces_for_agent(&self, agent: AgentId) -> Vec<&MemorySpace>
List all spaces that agent owns or has an ACL entry in.
Trait Implementations§
Source§impl Debug for SpaceManager
impl Debug for SpaceManager
Source§impl Default for SpaceManager
impl Default for SpaceManager
Source§fn default() -> SpaceManager
fn default() -> SpaceManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpaceManager
impl RefUnwindSafe for SpaceManager
impl Send for SpaceManager
impl Sync for SpaceManager
impl Unpin for SpaceManager
impl UnsafeUnpin for SpaceManager
impl UnwindSafe for SpaceManager
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