Struct debug_cell::RefCell [] [src]

pub struct RefCell<T: ?Sized> {
    // some fields omitted
}

A clone of the standard library's RefCell type.

Methods

impl<T> RefCell<T>
[src]

fn new(value: T) -> RefCell<T>

Creates a new RefCell containing value.

fn into_inner(self) -> T

Consumes the RefCell, returning the wrapped value.

impl<T: ?Sized> RefCell<T>
[src]

fn borrow<'a>(&'a self) -> Ref<'a, T>

Immutably borrows the wrapped value.

The borrow lasts until the returned Ref exits scope. Multiple immutable borrows can be taken out at the same time.

Panics

Panics if the value is currently mutably borrowed.

fn borrow_mut<'a>(&'a self) -> RefMut<'a, T>

Mutably borrows the wrapped value.

The borrow lasts until the returned RefMut exits scope. The value cannot be borrowed while this borrow is active.

Panics

Panics if the value is currently borrowed.

Trait Implementations

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

impl<T: Clone> Clone for RefCell<T>
[src]

fn clone(&self) -> RefCell<T>

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)
1.0.0

Performs copy-assignment from source. Read more

impl<T: Default> Default for RefCell<T>
[src]

fn default() -> RefCell<T>

Returns the "default value" for a type. Read more

impl<T: ?Sized + PartialEq> PartialEq for RefCell<T>
[src]

fn eq(&self, other: &RefCell<T>) -> bool

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Rhs) -> bool
1.0.0

This method tests for !=.

impl<T: ?Sized + Eq> Eq for RefCell<T>
[src]