pub enum Fixed<T> {
Static(*mut T),
Owned(Pin<Box<UnsafeCell<T>>>),
}
Expand description
Objects that can be fixed or allocated.
When using Rust threads from userspace, the kobj_define
declarations and the complexity behind
it is required. If all Rust use of kernel objects is from system threads, and dynamic memory is
available, kernel objects can be freeallocated, as long as the allocations themselves are
pinned. This Fixed
encapsulates both of these.
Variants§
Static(*mut T)
Objects that have been statically declared and just pointed to.
Owned(Pin<Box<UnsafeCell<T>>>)
Objects that are owned by the wrapper, and contained here.
Implementations§
Auto Trait Implementations§
impl<T> Freeze for Fixed<T>
impl<T> !RefUnwindSafe for Fixed<T>
impl<T> !Send for Fixed<T>
impl<T> !Sync for Fixed<T>
impl<T> Unpin for Fixed<T>
impl<T> UnwindSafe for Fixed<T>where
T: RefUnwindSafe + UnwindSafe,
Blanket Implementations§
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