[][src]Trait new_home_application::method::method_manager::MethodManager

pub trait MethodManager {
    fn add_method(&mut self, method: Method, callable: Box<dyn MethodCallable>);
fn get_method(&self, name: &String) -> Option<Method>;
fn get_method_callback(
        &self,
        name: &String
    ) -> Option<&Box<dyn MethodCallable>>;
fn get_methods(&self) -> HashMap<String, Method>; }

The MethodManager contains all methods with information about their name, description and help as well as the arguments that can be supplied by the callee Contains MethodCallables in relation with the methods name The name for a method is given by the Method struct

Required methods

fn add_method(&mut self, method: Method, callable: Box<dyn MethodCallable>)

Registers the given Method struct with the given callable Uses the name of the Method struct as the name for the method used in later calls

fn get_method(&self, name: &String) -> Option<Method>

Gets the method definition for the method by the given name Returns the Method if exists, otherwise returns a None

fn get_method_callback(&self, name: &String) -> Option<&Box<dyn MethodCallable>>

Gets a method callback from the given name If it exists the MethodCallable is returned otherwise a None is returned

fn get_methods(&self) -> HashMap<String, Method>

Returns a Map filled with method names as key and the Method description as value Creates a new copy of its own index at the current time

Loading content...

Implementors

impl MethodManager for MethodManagerImpl[src]

Loading content...