pub struct Grant<T: Default, Upcalls: UpcallSize, AllowROs: AllowRoSize, AllowRWs: AllowRwSize> { /* private fields */ }
Expand description

Type for storing an object of type T in process memory that is only accessible by the kernel.

A single Grant can allocate space for one object of type T for each process on the board. Each allocated object will reside in the grant region belonging to the process that the object is allocated for. The Grant type is used to get access to ProcessGrants, which are tied to a specific process and provide access to the memory object allocated for that process.

Implementations

Enter the grant for a specific process.

This creates a ProcessGrant which is a handle for a grant allocated for a specific process. Then, that ProcessGrant is entered and the provided closure is run with access to the memory in the grant region.

Enter the grant for a specific process with access to an allocator.

This creates an ProcessGrant which is a handle for a grant allocated for a specific process. Then, that ProcessGrant is entered and the provided closure is run with access to the memory in the grant region.

The allocator allows the caller to dynamically allocate additional memory in the process’s grant region.

Run a function on the grant for each active process if the grant has been allocated for that process.

This will silently skip any process where the grant has not previously been allocated. This will also silently skip any invalid processes.

Calling this function when an ProcessGrant for a process is currently entered will result in a panic.

Get an iterator over all processes and their active grant regions for this particular grant.

Calling this function when an ProcessGrant for a process is currently entered will result in a panic.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.