⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

ProcessIsolation

Struct ProcessIsolation 

Source
pub struct ProcessIsolation { /* private fields */ }
Expand description

Manages all tab processes and their isolation

Implementations§

Source§

impl ProcessIsolation

Source

pub fn new() -> Self

Source

pub fn spawn_tab_process(&mut self, tab_id: TabId) -> Result<(), TabError>

Spawn a new tab process

Source

pub fn spawn_with_capabilities( &mut self, tab_id: TabId, capabilities: TabCapabilities, ) -> Result<(), TabError>

Spawn with custom capabilities

Source

pub fn kill_tab_process(&mut self, tab_id: TabId) -> bool

Kill a tab process

Source

pub fn recover_from_crash(&mut self, tab_id: TabId) -> Result<(), TabError>

Recover a crashed tab process (recreate its context)

Source

pub fn restrict_capabilities( &mut self, tab_id: TabId, capabilities: TabCapabilities, ) -> bool

Restrict capabilities for a tab

Source

pub fn get_process(&self, tab_id: TabId) -> Option<&TabProcess>

Get a tab process

Source

pub fn get_process_mut(&mut self, tab_id: TabId) -> Option<&mut TabProcess>

Get a tab process mutably

Source

pub fn post_message( &mut self, source: TabId, target: TabId, data: &str, ) -> Result<(), TabError>

Send postMessage from one tab to another

Source

pub fn subscribe_broadcast(&mut self, tab_id: TabId, channel: &str) -> bool

Subscribe a tab to a broadcast channel

Source

pub fn unsubscribe_broadcast(&mut self, tab_id: TabId, channel: &str)

Unsubscribe a tab from a broadcast channel

Source

pub fn broadcast_message( &mut self, source: TabId, channel: &str, data: &str, ) -> usize

Send a broadcast message to all subscribers of a channel

Source

pub fn storage_set(&mut self, origin: &str, key: &str, value: &str)

Set a value in shared storage for an origin

Source

pub fn storage_get(&self, origin: &str, key: &str) -> Option<&String>

Get a value from shared storage

Source

pub fn storage_remove(&mut self, origin: &str, key: &str) -> Option<String>

Remove a value from shared storage

Source

pub fn tick_all(&mut self)

Tick all running processes

Source

pub fn suspend_background_tabs(&mut self, active_tab: TabId)

Suspend all background tab processes

Source

pub fn resume_tab(&mut self, tab_id: TabId) -> bool

Resume a specific tab process

Source

pub fn active_count(&self) -> usize

Number of active processes

Source

pub fn total_count(&self) -> usize

Total number of processes

Source

pub fn total_crashes(&self) -> usize

Total crashes across all tabs

Source

pub fn resource_usage(&self, tab_id: TabId) -> Option<&ResourceUsage>

Get resource usage for a tab

Source

pub fn aggregate_usage(&self) -> ResourceUsage

Get aggregate resource usage across all tabs

Trait Implementations§

Source§

impl Default for ProcessIsolation

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for ProcessIsolation

§

impl RefUnwindSafe for ProcessIsolation

§

impl Send for ProcessIsolation

§

impl Sync for ProcessIsolation

§

impl Unpin for ProcessIsolation

§

impl UnwindSafe for ProcessIsolation

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn into(self) -> U

Calls U::from(self).

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

§

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

§

type Error = Infallible

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

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

Performs the conversion.
§

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

§

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

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

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

Performs the conversion.