Skip to main content

TaskAddressSpace

Struct TaskAddressSpace 

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

Move-only runtime token for one user address space.

Implementations§

Source§

impl TaskAddressSpace

Source

pub fn new( root: PhysAddr, owner: impl Send + Sync + 'static, ) -> Result<Self, TaskError>

Creates a scheduler token that owns owner until address-space reap.

Source

pub fn new_with_task_detach<T: Send + Sync + 'static>( root: PhysAddr, cpu_state: Arc<AddressSpaceCpuState>, owner: T, detach: fn(&T), ) -> Result<Self, TaskError>

Creates a scheduler token with task-detach ownership semantics.

detach runs once in ordinary task context after the attached thread has entered lazy kernel-mm state. It may release task-scoped accounting, but owner must keep the hardware page-table root valid until its final drop after all active-CPU leases have drained.

Source

pub fn new_managed<T: UserAddressSpaceOwner + 'static>( root: PhysAddr, cpu_state: Arc<AddressSpaceCpuState>, owner: T, ) -> Result<Self, TaskError>

Creates a task token backed by an OS-owned MM lifecycle. Allocation occurs here in task context, before scheduler publication.

Trait Implementations§

Source§

impl Drop for TaskAddressSpace

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. 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> Pointee for T

Source§

type Metadata = ()

The metadata type for pointers and references to this type.
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.