Struct krush_engine::Definition
source · 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: Box<dyn FnMut(Vec<Value>) -> Option<String> + 'a> ) -> Self
pub fn new( args: Vec<Type>, callback: Box<dyn FnMut(Vec<Value>) -> Option<String> + 'a> ) -> Self
pub fn args(&self) -> &Vec<Type>
pub fn callback( &mut self ) -> &mut Box<dyn FnMut(Vec<Value>) -> Option<String> + 'a>
Auto Trait Implementations§
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