[][src]Trait dioptre::ext::CellExt

pub trait CellExt {
    type Inner;
    fn project<T>(&self, field: Field<Self::Inner, T>) -> &Cell<T>;
}

Additional methods for Cell.

Associated Types

type Inner

Loading content...

Required methods

fn project<T>(&self, field: Field<Self::Inner, T>) -> &Cell<T>

Access a field of a Cell.

use core::cell::Cell;
use dioptre::{Fields, ext::CellExt};

#[derive(Fields)]
struct Data {
    x: i32,
    y: i32,
}

fn process(data: &Cell<Data>) {
    data.project(Data::x).set(3);
    data.project(Data::y).set(5);
}
Loading content...

Implementations on Foreign Types

impl<S: Fields> CellExt for Cell<S>[src]

type Inner = S

Loading content...

Implementors

Loading content...