From 1d5a2cf45e15abb5c3ee3b50556a1d872800edb7 Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Fri, 14 Jun 2024 14:31:09 -0300 Subject: add Component missing functions --- rust/src/component.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'rust/src') diff --git a/rust/src/component.rs b/rust/src/component.rs index e17efabf..bee101be 100644 --- a/rust/src/component.rs +++ b/rust/src/component.rs @@ -227,8 +227,32 @@ impl Component { }; unsafe { Array::new(result, count, ()) } } + + pub fn remove_itself(&self) -> bool { + unsafe { BNComponentRemoveComponent(self.as_raw()) } + } + + pub fn remove_all_functions(&self) { + unsafe { BNComponentRemoveAllFunctions(self.as_raw()) } + } + + pub fn add_all_members(&self, component: &Component) { + unsafe { BNComponentAddAllMembersFromComponent(self.as_raw(), component.as_raw()) } + } } +impl PartialEq for Component { + fn eq(&self, other: &Self) -> bool { + unsafe { BNComponentsEqual(self.as_raw(), other.as_raw()) } + } + + fn ne(&self, other: &Self) -> bool { + unsafe { BNComponentsNotEqual(self.as_raw(), other.as_raw()) } + } +} + +impl Eq for Component {} + impl Drop for Component { fn drop(&mut self) { unsafe { BNFreeComponent(self.as_raw()) } -- cgit v1.3.1