Struct kiss_ui::utils::move_cell::MoveCell [] [src]

pub struct MoveCell<T>(_);

A cell type that can move values into and out of a shared reference.

Methods

impl<T> MoveCell<T>

fn new() -> MoveCell<T>

Create a new MoveCell with no contained value.

fn with(val: T) -> MoveCell<T>

Create a new MoveCell with the given value.

fn from(opt: Option<T>) -> MoveCell<T>

Create a new MoveCell<T> around the given Option<T>.

fn put(&self, val: T) -> Option<T>

Place a value into this MoveCell, returning the previous value, if present.

fn take(&self) -> Option<T>

Take the value out of this MoveCell, leaving nothing in its place.

fn clone_inner(&self) -> Option<T> where T: Clone

Take the value out of this MoveCell, leaving a clone in its place.

fn has_value(&self) -> bool

Check if this MoveCell contains a value or not.

Trait Implementations

impl<T> Default for MoveCell<T>

fn default() -> Self