pub struct UPSafeCell<T> {
    inner: RefCell<T>,
}
Expand description

Wrap a static data structure inside it so that we are able to access it without any unsafe.

We should only use it in uniprocessor.

In order to get mutable reference of inner data, call exclusive_access.

Fields

inner: RefCell<T>

inner data

Implementations

User is responsible to guarantee that inner struct is only used in uniprocessor.

Exclusive access inner data in UPSafeCell. Panic if the data has been borrowed.

Trait Implementations

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.