libadwaita/
toast.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::Toast;
4use glib::translate::*;
5use glib::variant::ToVariant;
6
7impl Toast {
8    #[doc(alias = "adw_toast_set_action_target")]
9    #[doc(alias = "adw_toast_set_action_target_value")]
10    pub fn set_action_target(&self, target: Option<&impl ToVariant>) {
11        unsafe {
12            ffi::adw_toast_set_action_target_value(
13                self.to_glib_none().0,
14                target.map(|v| v.to_variant()).to_glib_none().0,
15            );
16        }
17    }
18}