Struct relm4::actions::RelmAction
source · pub struct RelmAction<Name: ActionName> { /* private fields */ }
Expand description
A type safe action that wraps around gio::SimpleAction
.
Implementations§
source§impl<Name: ActionName> RelmAction<Name>where
Name::State: ToVariant + FromVariant,
Name::Target: ToVariant + FromVariant,
impl<Name: ActionName> RelmAction<Name>where Name::State: ToVariant + FromVariant, Name::Target: ToVariant + FromVariant,
sourcepub fn new_stateful_with_target_value<Callback: Fn(&SimpleAction, &mut Name::State, Name::Target) + 'static>(
start_value: &Name::State,
callback: Callback
) -> Self
pub fn new_stateful_with_target_value<Callback: Fn(&SimpleAction, &mut Name::State, Name::Target) + 'static>( start_value: &Name::State, callback: Callback ) -> Self
Create a new stateful action with target value.
source§impl<Name: ActionName> RelmAction<Name>where
Name::State: ToVariant + FromVariant,
Name::Target: EmptyType,
impl<Name: ActionName> RelmAction<Name>where Name::State: ToVariant + FromVariant, Name::Target: EmptyType,
sourcepub fn new_stateful<Callback: Fn(&SimpleAction, &mut Name::State) + 'static>(
start_value: &Name::State,
callback: Callback
) -> Self
pub fn new_stateful<Callback: Fn(&SimpleAction, &mut Name::State) + 'static>( start_value: &Name::State, callback: Callback ) -> Self
Create a new stateful action.
source§impl<Name: ActionName> RelmAction<Name>where
Name::State: EmptyType,
Name::Target: ToVariant + FromVariant,
impl<Name: ActionName> RelmAction<Name>where Name::State: EmptyType, Name::Target: ToVariant + FromVariant,
sourcepub fn new_with_target_value<Callback: Fn(&SimpleAction, Name::Target) + 'static>(
callback: Callback
) -> Self
pub fn new_with_target_value<Callback: Fn(&SimpleAction, Name::Target) + 'static>( callback: Callback ) -> Self
Create a new stateless action with a target value.
source§impl<Name: ActionName> RelmAction<Name>where
Name::Target: EmptyType,
Name::State: EmptyType,
impl<Name: ActionName> RelmAction<Name>where Name::Target: EmptyType, Name::State: EmptyType,
sourcepub fn new_stateless<Callback: Fn(&SimpleAction) + 'static>(
callback: Callback
) -> Self
pub fn new_stateless<Callback: Fn(&SimpleAction) + 'static>( callback: Callback ) -> Self
Create a new stateless action.
source§impl<Name: ActionName> RelmAction<Name>where
Name::Target: ToVariant + FromVariant,
impl<Name: ActionName> RelmAction<Name>where Name::Target: ToVariant + FromVariant,
Create a menu item for this action with the target value sent to the action on activation.
source§impl<Name: ActionName> RelmAction<Name>where
Name::Target: EmptyType,
impl<Name: ActionName> RelmAction<Name>where Name::Target: EmptyType,
Create a menu item for this action.