pub struct FunctionSet { /* private fields */ }Expand description
A collection of functions associated with a specific context type.
This type is used to construct a set of functions for a Context.
Once registered, these functions are referred to as methods within this crate,
and can be invoked from AS3 via ExtensionContext.call.
Implementations§
Source§impl FunctionSet
impl FunctionSet
pub fn new() -> Self
pub fn with_capacity(capacity: usize) -> Self
Sourcepub fn add(
&mut self,
name: Option<UCStr>,
func_data: Option<Box<dyn Any>>,
func_impl: &'static FunctionImplementation,
)
pub fn add( &mut self, name: Option<UCStr>, func_data: Option<Box<dyn Any>>, func_impl: &'static FunctionImplementation, )
Adds a function that can be registered as a method.
§Parameters
name: The method name. IfNone, the raw name offunc_implis used.func_data: Data associated with this method. It will be dropped afterContextFinalizerreturns.func_impl: The method implementation created by thefunction!macro.
§Panics
Panics if a function with the same name has already been added.
Callers must ensure that each name is unique within this set.
Trait Implementations§
Source§impl Debug for FunctionSet
impl Debug for FunctionSet
Auto Trait Implementations§
impl Freeze for FunctionSet
impl RefUnwindSafe for FunctionSet
impl !Send for FunctionSet
impl !Sync for FunctionSet
impl Unpin for FunctionSet
impl UnsafeUnpin for FunctionSet
impl UnwindSafe for FunctionSet
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more