Trait r3::bind::UnzipBind

source ·
pub trait UnzipBind {
    type Target;

    // Required method
    fn unzip(self) -> Self::Target;
}
Expand description

An extension trait for destructing Bind<_, (T0, T1, ...)> into individual bindings (Bind<_, T0>, Bind<_, T1>, ...).

Temporary Restrictions: Currently the destruction makes the original value completely inaccessible owing to it being implemented by BindTakeMut. Essentially, this divides the timeline into two parts: the first part where only the pre-destruction binding (Bind<_, (T0, T1, ...)>) can be borrowed and the second part where only the post-destruction bindings (Bind<_, T0>, Bind<_, T1>, ...) can be borrowed.

Examples

#![feature(const_trait_impl)]
#![feature(const_mut_refs)]
use r3_core::{bind::Bind, kernel::{Cfg, traits}, prelude::*};

const fn configure_app<C>(cfg: &mut Cfg<C>)
where
    C: ~const traits::CfgStatic,
{
    let values = Bind::define().init(|| (12, 34)).finish(cfg);
    let (value0, value1) = values.unzip();
    Bind::define()
        .init_with_bind((value0.take_mut(),), |x: &mut i32| assert_eq!(*x, 12))
        .unpure()
        .finish(cfg);
    Bind::define()
        .init_with_bind((value1.take_mut(),), |x: &mut i32| assert_eq!(*x, 34))
        .unpure()
        .finish(cfg);
}

Stability

This trait is covered by the application-side API stability guarantee. External implementation of this trait is not allowed.

Required Associated Types§

Required Methods§

source

fn unzip(self) -> Self::Target

Destruct Bind into individual bindings.

Implementors§

source§

impl<'pool, System> UnzipBind for Bind<'pool, System, ()>

§

type Target = ()

source§

impl<'pool, System, Field0> UnzipBind for Bind<'pool, System, (Field0,)>

§

type Target = (Bind<'pool, System, Field0>,)

source§

impl<'pool, System, Field0, Field1> UnzipBind for Bind<'pool, System, (Field0, Field1)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>)

source§

impl<'pool, System, Field0, Field1, Field2> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>, Bind<'pool, System, Field12>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>, Bind<'pool, System, Field12>, Bind<'pool, System, Field13>)

source§

impl<'pool, System, Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14> UnzipBind for Bind<'pool, System, (Field0, Field1, Field2, Field3, Field4, Field5, Field6, Field7, Field8, Field9, Field10, Field11, Field12, Field13, Field14)>

§

type Target = (Bind<'pool, System, Field0>, Bind<'pool, System, Field1>, Bind<'pool, System, Field2>, Bind<'pool, System, Field3>, Bind<'pool, System, Field4>, Bind<'pool, System, Field5>, Bind<'pool, System, Field6>, Bind<'pool, System, Field7>, Bind<'pool, System, Field8>, Bind<'pool, System, Field9>, Bind<'pool, System, Field10>, Bind<'pool, System, Field11>, Bind<'pool, System, Field12>, Bind<'pool, System, Field13>, Bind<'pool, System, Field14>)

source§

impl<'pool, const LEN: usize, System, T> UnzipBind for Bind<'pool, System, [T; LEN]>

§

type Target = [Bind<'pool, System, T>; LEN]