MCPcopy Create free account
hub / github.com/Kaiden42/PWDuck / ButtonData

Class ButtonData

gui/src/utils.rs:16–27  ·  view source on GitHub ↗

Helper struct to reduce function argument count.

Source from the content-addressed store, hash-verified

14
15/// Helper struct to reduce function argument count.
16pub struct ButtonData<'a, Message: 'a + Clone> {
17 /// The [`State`](button::State) of the [`Button`](Button).
18 pub state: &'a mut button::State,
19 /// The icon of the [`Button`](Button).
20 pub icon: Icon,
21 /// The text of the [`Button`](Button).
22 pub text: &'a str,
23 /// The kind of a [`Button`](Button).
24 pub kind: ButtonKind,
25 /// The optional message that is send by the [`Button`](Button).
26 pub on_press: Option<Message>,
27}
28
29impl<'a, Message: 'a + Clone> ButtonData<'a, Message> {
30 /// Create the element containing only the icon.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected