From 7b37916381499d0fda827e2ee156cb5f94f6298b Mon Sep 17 00:00:00 2001 From: szymon Date: Sun, 4 Oct 2026 15:05:36 +0200 Subject: [PATCH] docs: add docs to callback helper functions --- src/api/notification.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/api/notification.rs b/src/api/notification.rs index 37cd24c..f3bc057 100644 --- a/src/api/notification.rs +++ b/src/api/notification.rs @@ -524,6 +524,7 @@ impl Drop for Notification { } } +/// This function translates c callback to rust. Used in `add_action` unsafe extern "C" fn action_trampoline( _notification: *mut NotifyNotification, action: *mut ::std::os::raw::c_char, @@ -541,6 +542,7 @@ unsafe extern "C" fn action_trampoline( callback(&action); } +/// This function tells c how to free memory of our callback unsafe extern "C" fn drop_box(data: gpointer) { unsafe { drop(Box::from_raw(data as *mut F)) }; }