From 0c55bf12f6148a8f3c4b1af66c950d73e371b351 Mon Sep 17 00:00:00 2001 From: Alexander Taylor Date: Mon, 3 Nov 2025 14:31:20 -0500 Subject: Add helpers for whether a function is exported. --- rust/src/function.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'rust/src/function.rs') diff --git a/rust/src/function.rs b/rust/src/function.rs index 1a4add05..c0e00bd1 100644 --- a/rust/src/function.rs +++ b/rust/src/function.rs @@ -26,7 +26,7 @@ use crate::{ platform::Platform, references::CodeReference, string::*, - symbol::Symbol, + symbol::{Binding, Symbol}, tags::{Tag, TagReference, TagType}, types::{IntegerDisplayType, QualifiedName, Type}, }; @@ -344,6 +344,12 @@ impl Function { } } + /// Returns true when the function's symbol binding marks it as exported. + pub fn is_exported(&self) -> bool { + let symbol = self.symbol(); + matches!(symbol.binding(), Binding::Global | Binding::Weak) + } + pub fn workflow(&self) -> Option> { unsafe { let workflow = NonNull::new(BNGetWorkflowForFunction(self.handle))?; -- cgit v1.3.1