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

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.

Fields

ptr: *const T

Methods

impl<T> StaticRef<T>[src]

pub const unsafe fn new(ptr: *const T) -> StaticRef<T>[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: Debug> Debug for StaticRef<T>[src]

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

type Target = T

The resulting type after dereferencing.

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

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

Auto Trait Implementations

impl<T> Unpin for StaticRef<T>

impl<T> !Send for StaticRef<T>

impl<T> !Sync for StaticRef<T>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]