IsolationDomain

Struct IsolationDomain 

Source
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

Source

pub fn new( thread_id: ThreadId, config: IsolationConfig, ) -> Result<Self, ThreadError>

Create new isolation domain.

Source

pub fn check_cross_domain_access( &self, target_domain: ThreadId, access_type: AccessType, ) -> bool

Check if cross-domain access is allowed.

Source

pub fn allow_domain_interaction(&mut self, domain_id: ThreadId)

Add allowed domain for interaction.

Source

pub fn disallow_domain_interaction(&mut self, domain_id: ThreadId)

Remove allowed domain.

Source

pub fn check_memory_access( &self, address: usize, size: usize, write: bool, ) -> bool

Check if memory access is allowed.

Source

pub fn update_resource_usage( &mut self, usage: ResourceUsage, ) -> Result<(), ThreadError>

Update resource usage and check limits.

Trait Implementations§

Source§

impl Debug for IsolationDomain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.