pub struct ContextStack;
Expand description

Type used to represent the thread-local context stack.

Implementations§

Pop the current context off the stack and return the handle. That context may then be made current again (perhaps on a different CPU thread) by calling push.

Example:
let context = Context::create_and_push(ContextFlags::MAP_HOST | ContextFlags::SCHED_AUTO, device).unwrap();
let unowned = ContextStack::pop().unwrap();

Push the given context to the top of the stack

Example:
let context = Context::create_and_push(ContextFlags::MAP_HOST | ContextFlags::SCHED_AUTO, device).unwrap();
let unowned = ContextStack::pop().unwrap();
ContextStack::push(&unowned).unwrap();

Trait Implementations§

Formats the value using the given formatter. Read more

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.