From 91008acd3e20254e18cb0a064ade2a8e14b61ce4 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Sun, 9 Apr 2023 14:05:04 +0200 Subject: [PATCH] fd_monitor.rs: make NativeCallback public The upcoming io.rs calls "FdMonitorItem::new". We cannot pass a closure, we must pass an object of type NativeCallback. --- fish-rust/src/fd_monitor.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fish-rust/src/fd_monitor.rs b/fish-rust/src/fd_monitor.rs index 30ff14f17..90c00580a 100644 --- a/fish-rust/src/fd_monitor.rs +++ b/fish-rust/src/fd_monitor.rs @@ -18,6 +18,7 @@ mod fd_monitor_ffi { /// Reason for waking an item #[repr(u8)] #[cxx_name = "item_wake_reason_t"] + #[derive(PartialEq, Eq)] enum ItemWakeReason { /// The fd became readable (or was HUP'd) Readable, @@ -107,7 +108,7 @@ fn from(value: u64) -> Self { } type FfiCallback = extern "C" fn(*mut AutoCloseFd, u8, void_ptr); -type NativeCallback = Box; +pub type NativeCallback = Box; /// The callback type used by [`FdMonitorItem`]. It is passed a mutable reference to the /// `FdMonitorItem`'s [`FdMonitorItem::fd`] and [the reason](ItemWakeupReason) for the wakeup. The