RKTK API Docs RKTK Home Repo

AllHooks

Trait AllHooks 

Source
pub trait AllHooks {
    type Common: CommonHooks;
    type Master: MasterHooks;
    type Slave: SlaveHooks;
    type Rgb: RgbHooks;

    // Required method
    fn destructure(
        self,
    ) -> Hooks<Self::Common, Self::Master, Self::Slave, Self::Rgb>;
}
Expand description

Makes it easier to pass around all hooks as a single type.

Without this trait, users would need to write out the full type of hooks like: Hooks<impl CommonHooks, impl MasterHooks, impl SlaveHooks, impl RgbHooks>. And this trait is implemented for Hooks<CH, MH, SH, RH> so users can just write impl AllHooks.

Though this trait is not sealed, it is not recommended to implement this trait for your own types.

Required Associated Types§

Required Methods§

Source

fn destructure( self, ) -> Hooks<Self::Common, Self::Master, Self::Slave, Self::Rgb>

Implementors§

Source§

impl<CH: CommonHooks, MH: MasterHooks, SH: SlaveHooks, RH: RgbHooks> AllHooks for Hooks<CH, MH, SH, RH>

Source§

type Common = CH

Source§

type Master = MH

Source§

type Slave = SH

Source§

type Rgb = RH