pub struct KernelSandbox { /* private fields */ }Expand description
Kernel sandbox for isolation and resource control.
Implementations§
Source§impl KernelSandbox
impl KernelSandbox
Sourcepub fn new(policy: SandboxPolicy) -> Self
pub fn new(policy: SandboxPolicy) -> Self
Create a new kernel sandbox.
Sourcepub fn apply_to_kernel(&mut self, kernel_id: KernelId)
pub fn apply_to_kernel(&mut self, kernel_id: KernelId)
Apply sandbox to a kernel.
Sourcepub fn check_memory(&self, bytes: u64) -> Result<(), SandboxViolation>
pub fn check_memory(&self, bytes: u64) -> Result<(), SandboxViolation>
Check memory usage against limits.
Sourcepub fn check_execution_time(&self) -> Result<(), SandboxViolation>
pub fn check_execution_time(&self) -> Result<(), SandboxViolation>
Check execution time against limits.
Sourcepub fn check_k2k(&self, destination: &str) -> Result<(), SandboxViolation>
pub fn check_k2k(&self, destination: &str) -> Result<(), SandboxViolation>
Check K2K destination against policy.
Sourcepub fn check_checkpoint(&self) -> Result<(), SandboxViolation>
pub fn check_checkpoint(&self) -> Result<(), SandboxViolation>
Check if checkpointing is allowed.
Sourcepub fn check_migration(&self) -> Result<(), SandboxViolation>
pub fn check_migration(&self) -> Result<(), SandboxViolation>
Check if migration is allowed.
Sourcepub fn record_message(&self) -> Result<(), SandboxViolation>
pub fn record_message(&self) -> Result<(), SandboxViolation>
Record a message for rate limiting.
Sourcepub fn violations(&self) -> Vec<SandboxViolation>
pub fn violations(&self) -> Vec<SandboxViolation>
Get all recorded violations.
Sourcepub fn stats(&self) -> SandboxStats
pub fn stats(&self) -> SandboxStats
Get sandbox statistics.
Sourcepub fn policy(&self) -> &SandboxPolicy
pub fn policy(&self) -> &SandboxPolicy
Get the policy.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for KernelSandbox
impl RefUnwindSafe for KernelSandbox
impl Send for KernelSandbox
impl Sync for KernelSandbox
impl Unpin for KernelSandbox
impl UnwindSafe for KernelSandbox
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.