Struct relm4::actions::RelmAction
source · [−]pub struct RelmAction<Name: ActionName> { /* private fields */ }
Expand description
A type safe action that wraps around gio::SimpleAction
.
Implementations
sourceimpl<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.
sourceimpl<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.
sourceimpl<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.
sourceimpl<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.
sourceimpl<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.
sourceimpl<Name: ActionName> RelmAction<Name> where
Name::Target: EmptyType,
impl<Name: ActionName> RelmAction<Name> where
Name::Target: EmptyType,
Create a menu item for this action.
Trait Implementations
sourceimpl<Name: Debug + ActionName> Debug for RelmAction<Name>
impl<Name: Debug + ActionName> Debug for RelmAction<Name>
Auto Trait Implementations
impl<Name> RefUnwindSafe for RelmAction<Name> where
Name: RefUnwindSafe,
impl<Name> !Send for RelmAction<Name>
impl<Name> !Sync for RelmAction<Name>
impl<Name> Unpin for RelmAction<Name> where
Name: Unpin,
impl<Name> UnwindSafe for RelmAction<Name> where
Name: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more