Skip to main content

Context

Struct Context 

Source
pub struct Context(/* private fields */);
Expand description

An fd-owned exception context bound to its creating address space.

Implementations§

Source§

impl Context

Source

pub unsafe fn create( device: BorrowedFd<'_>, slab_size: SlabSize, soft_limit: SoftSlabLimit, ) -> Result<Self>

Create the one exception context allowed for the current address space.

§Safety

device must be a descriptor created by Mirilla.

§Errors

This returns a kernel error or an invalid successful result from the foreign interface.

Source

pub const fn id(&self) -> ExceptionId

Return the kernel identifier.

Source

pub const fn slab_size(&self) -> SlabSize

Return the configured slab size.

Source

pub const fn soft_limit(&self) -> SoftSlabLimit

Return the configured userspace slab limit.

Source

pub fn allocated(&self) -> usize

Return the number of currently mapped slabs.

Source

pub fn map(&self) -> Result<Slab<'_>, SlabAllocationError>

Map one editable exception slab.

§Errors

This fails when the userspace soft limit is reached or the operating system rejects the mapping.

Trait Implementations§

Source§

impl Debug for Context

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<I> Immortal for I
where I: 'static,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.