[][src]Struct mini_haskell::rc_view::RcView

pub struct RcView<T: ?Sized, U: ?Sized> { /* fields omitted */ }

A view into an Rc.

Implementations

impl<T: ?Sized, U: ?Sized> RcView<T, U>[src]

pub fn new(whole: Rc<T>, to_focus: impl FnOnce(&T) -> &U) -> Self[src]

Create a view into an Rc.

pub unsafe fn wrap(whole: Rc<T>, focus: &U) -> Self[src]

Create a view into an Rc.

Safety

Call on this unsafe functions should take special care so that the provided reference focus is indeed a view into the related Rc.

pub fn map<V: ?Sized>(self, f: impl FnOnce(&U) -> &V) -> RcView<T, V>[src]

Refocus the view.

pub unsafe fn derive<V: ?Sized>(&self, focus: &V) -> RcView<T, V>[src]

Derive an RcView to a new focus from this view.

Safety

Call on this unsafe functions should take special care so that the provided reference focus is indeed a view into the related Rc.

pub unsafe fn derive_take<V: ?Sized>(self, focus: &V) -> RcView<T, V>[src]

Derive an RcView to a new focus from this view. Consumes this view.

Safety

Call on this unsafe functions should take special care so that the provided reference focus is indeed a view into the related Rc.

Trait Implementations

impl<T: ?Sized, U: Debug + ?Sized> Debug for RcView<T, U>[src]

impl<T: ?Sized, U: ?Sized> Deref for RcView<T, U>[src]

type Target = U

The resulting type after dereferencing.

impl<T: ?Sized, U: Display + ?Sized> Display for RcView<T, U>[src]

impl<T: ?Sized> From<Rc<T>> for RcView<T, T>[src]

impl<T: ?Sized, U> From<RcView<UnsafeCell<T>, Option<U>>> for Option<U>[src]

Auto Trait Implementations

impl<T, U> !RefUnwindSafe for RcView<T, U>

impl<T, U> !Send for RcView<T, U>

impl<T, U> !Sync for RcView<T, U>

impl<T: ?Sized, U: ?Sized> Unpin for RcView<T, U>

impl<T: ?Sized, U: ?Sized> UnwindSafe for RcView<T, U> where
    T: RefUnwindSafe,
    U: RefUnwindSafe

Blanket Implementations

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

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

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

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

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

impl<T> ToString for T where
    T: Display + ?Sized
[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> 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.