pub struct IsolationDomain {
pub thread_id: ThreadId,
pub config: IsolationConfig,
pub resource_usage: ResourceUsage,
pub allowed_domains: Vec<ThreadId>,
pub created_at: u64,
}
Expand description
Individual thread isolation domain.
Fields§
§thread_id: ThreadId
Thread ID for this domain
config: IsolationConfig
Domain configuration
resource_usage: ResourceUsage
Current resource usage
allowed_domains: Vec<ThreadId>
Allowed domain interactions
created_at: u64
Domain creation time
Implementations§
Source§impl IsolationDomain
impl IsolationDomain
Sourcepub fn new(
thread_id: ThreadId,
config: IsolationConfig,
) -> Result<Self, ThreadError>
pub fn new( thread_id: ThreadId, config: IsolationConfig, ) -> Result<Self, ThreadError>
Create new isolation domain.
Sourcepub fn check_cross_domain_access(
&self,
target_domain: ThreadId,
access_type: AccessType,
) -> bool
pub fn check_cross_domain_access( &self, target_domain: ThreadId, access_type: AccessType, ) -> bool
Check if cross-domain access is allowed.
Sourcepub fn allow_domain_interaction(&mut self, domain_id: ThreadId)
pub fn allow_domain_interaction(&mut self, domain_id: ThreadId)
Add allowed domain for interaction.
Sourcepub fn disallow_domain_interaction(&mut self, domain_id: ThreadId)
pub fn disallow_domain_interaction(&mut self, domain_id: ThreadId)
Remove allowed domain.
Sourcepub fn check_memory_access(
&self,
address: usize,
size: usize,
write: bool,
) -> bool
pub fn check_memory_access( &self, address: usize, size: usize, write: bool, ) -> bool
Check if memory access is allowed.
Sourcepub fn update_resource_usage(
&mut self,
usage: ResourceUsage,
) -> Result<(), ThreadError>
pub fn update_resource_usage( &mut self, usage: ResourceUsage, ) -> Result<(), ThreadError>
Update resource usage and check limits.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IsolationDomain
impl RefUnwindSafe for IsolationDomain
impl Send for IsolationDomain
impl Sync for IsolationDomain
impl Unpin for IsolationDomain
impl UnwindSafe for IsolationDomain
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