Struct cortex_m_rtfm::Static
[−]
[src]
#[repr(C)]pub struct Static<T> where
T: ?Sized, { /* fields omitted */ }
A value stored in a static
variable
Methods
impl<T> Static<T>
[src]
const unsafe fn new(value: T) -> Static<T>
Asserts that this value
is stored in a static
variable
unsafe fn ref_(r: &'a T) -> &'a Static<T>
Asserts that the reference r
points to data stored in a static
variable
unsafe fn ref_mut(r: &'a mut T) -> &'a mut Static<T>
Asserts that the reference r
points to data stored in a static
variable
fn wrap(r: &'static T) -> &'static Static<T>
Wraps a static reference into Static
fn wrap_mut(r: &'static mut T) -> &'static mut Static<T>
Wraps a mutable static reference into Static
Trait Implementations
impl<T> Resource for Static<T> where
T: Send,
[src]
T: Send,
type Data = T
The data protected by the resource
fn borrow(&'cs self, _cs: &'cs Threshold) -> &'cs Static<T>
Borrows the resource data for the duration of a critical section Read more
fn borrow_mut(&'cs mut self, _cs: &'cs Threshold) -> &'cs mut Static<T>
Mutable variant of borrow
fn claim<R, F>(&self, t: &mut Threshold, f: F) -> R where
F: FnOnce(&Static<<Static<T> as Resource>::Data>, &mut Threshold) -> R,
F: FnOnce(&Static<<Static<T> as Resource>::Data>, &mut Threshold) -> R,
Claims the resource data for the span of the closure f
. For the duration of the closure other tasks that may access the resource data are prevented from preempting the current task. Read more
fn claim_mut<R, F>(&mut self, t: &mut Threshold, f: F) -> R where
F: FnOnce(&mut Static<<Static<T> as Resource>::Data>, &mut Threshold) -> R,
F: FnOnce(&mut Static<<Static<T> as Resource>::Data>, &mut Threshold) -> R,
Mutable variant of claim