Struct kernel::common::StaticRef[][src]

pub struct StaticRef<T> {
    ptr: *const T,

A pointer to statically allocated mutable data such as memory mapped I/O registers.

This is a simple wrapper around a raw pointer that encapsulates an unsafe dereference in a safe manner. It serve the role of creating a &'static T given a raw address and acts similarly to extern definitions, except StaticRef is subject to module and crate boundaries, while extern definitions can be imported anywhere.



impl<T> StaticRef<T>

Create a new StaticRef from a raw pointer


Callers must pass in a reference to statically allocated memory which does not overlap with other values.

Trait Implementations

impl<T: Debug> Debug for StaticRef<T>

Formats the value using the given formatter. Read more

impl<T> Clone for StaticRef<T>

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Copy for StaticRef<T>

impl<T> Deref for StaticRef<T>

The resulting type after dereferencing.

Dereferences the value.

Auto Trait Implementations

impl<T> !Send for StaticRef<T>

impl<T> !Sync for StaticRef<T>