diff options
| author | Alexander Taylor <alex@vector35.com> | 2025-11-03 14:31:20 -0500 |
|---|---|---|
| committer | Alexander Taylor <alex@vector35.com> | 2025-11-03 14:34:48 -0500 |
| commit | 0c55bf12f6148a8f3c4b1af66c950d73e371b351 (patch) | |
| tree | 18b067b2d5f81a15e726fa7c4c43911f8d774476 /rust/src | |
| parent | 4bbf5434655da660322205b9db590c524bef4aa8 (diff) | |
Add helpers for whether a function is exported.
Diffstat (limited to 'rust/src')
| -rw-r--r-- | rust/src/function.rs | 8 |
1 files changed, 7 insertions, 1 deletions
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<Ref<Workflow>> { unsafe { let workflow = NonNull::new(BNGetWorkflowForFunction(self.handle))?; |
