Struct kernel::common::static_ref::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 bounderies, while extern definitions can be imported anywhere.

TODO(alevy): move into common crate or replace with other mechanism.

Fields

Methods

impl<T> StaticRef<T>
[src]

[src]

Create a new StaticRef from a raw pointer

Safety

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

Trait Implementations

impl<T> Deref for StaticRef<T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.