Struct current::Current [] [src]

pub struct Current<T>(_);

The current value of a type.

Methods

impl<T> Current<T> where T: Any
[src]

unsafe fn new() -> Current<T>

Creates a new current object

unsafe fn current(&mut self) -> Option<&mut T>

Gets mutable reference to current object. Requires mutable reference to prevent access to globals in safe code, and to prevent mutable borrows of same value in scope. Is unsafe because returned reference inherits lifetime from argument.

unsafe fn current_unwrap(&mut self) -> &mut T

Unwraps mutable reference to current object, but with nicer error message.

Trait Implementations

impl<T> Deref for Current<T> where T: Any
[src]

type Target = T

The resulting type after dereferencing

fn deref<'a>(&'a self) -> &'a T

The method called to dereference a value

impl<T> DerefMut for Current<T> where T: Any
[src]

fn deref_mut<'a>(&'a mut self) -> &'a mut T

The method called to mutably dereference a value