pub struct Definition<'a> { /* private fields */ }
Expand description
Structure where to set the arguments using Type
and the callback function to be called on the command evaluation by [Engine::evaluate
] crate::Value::unwrap_str()
Implementations§
Source§impl<'a> Definition<'a>
impl<'a> Definition<'a>
pub fn build( args: &[Type], callback: Arc<Mutex<dyn FnMut(Vec<Value>) -> Option<String> + Send + 'a>>, ) -> Self
pub fn new( args: Vec<Type>, callback: Arc<Mutex<dyn FnMut(Vec<Value>) -> Option<String> + Send + 'a>>, ) -> Self
pub fn args(&self) -> &Vec<Type>
pub fn callback( &mut self, ) -> &mut Arc<Mutex<dyn FnMut(Vec<Value>) -> Option<String> + Send + 'a>>
Trait Implementations§
Source§impl<'a> Clone for Definition<'a>
impl<'a> Clone for Definition<'a>
Source§fn clone(&self) -> Definition<'a>
fn clone(&self) -> Definition<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for Definition<'a>
impl<'a> RefUnwindSafe for Definition<'a>
impl<'a> Send for Definition<'a>
impl<'a> Sync for Definition<'a>
impl<'a> Unpin for Definition<'a>
impl<'a> UnwindSafe for Definition<'a>
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