Struct clightningrpc_plugin::plugin::Plugin
source · [−]pub struct Plugin<T> where
T: Clone, {
pub option: HashSet<RpcOption>,
pub rpc_method: HashMap<String, Box<dyn RPCCommand<T>>>,
pub rpc_info: HashSet<RPCMethodInfo>,
pub rpc_hook: HashMap<String, Box<dyn RPCCommand<T>>>,
pub hook_info: HashSet<RPCHookInfo>,
pub rpc_notification: HashMap<String, Box<dyn RPCCommand<T>>>,
pub dynamic: bool,
/* private fields */
}Fields
option: HashSet<RpcOption>all the option contained inside the hash map.
rpc_method: HashMap<String, Box<dyn RPCCommand<T>>>all the options rpc method that the plugin need to support, included the builtin rpc method.
rpc_info: HashSet<RPCMethodInfo>keep the info of the method in a separate list FIXME: move the RPCMethodInfo as key of the rpc_method map.
rpc_hook: HashMap<String, Box<dyn RPCCommand<T>>>all the hook where the plugin is register during the configuration
hook_info: HashSet<RPCHookInfo>keep all the info about the hooks in a separate set. FIXME: put the RPCHookInfo as key of the hash map.
rpc_notification: HashMap<String, Box<dyn RPCCommand<T>>>all the notification that the plugin is register on
dynamic: boolmark a plugin as dynamic, in this way the plugin can be run from core lightning without stop the lightningd daemon
Implementations
sourceimpl<'a, T: 'a + Clone> Plugin<T>
impl<'a, T: 'a + Clone> Plugin<T>
pub fn new(state: T, dynamic: bool) -> Self
pub fn log(&self, level: LogLevel, msg: &str) -> &Self
pub fn add_opt(
&mut self,
name: &str,
opt_type: &str,
def_val: Option<String>,
description: &str,
deprecated: bool
) -> &mut Self
pub fn add_rpc_method<F: 'static>(
&'a mut self,
name: &str,
usage: &str,
description: &str,
callback: F
) -> &'_ mut Self where
F: RPCCommand<T> + 'static,
pub fn register_hook<F: 'static>(
&'a mut self,
hook_name: &str,
before: Option<Vec<String>>,
after: Option<Vec<String>>,
callback: F
) -> &'_ mut Self where
F: RPCCommand<T> + 'static,
pub fn register_notification<F: 'static>(
&mut self,
name: &str,
callback: F
) -> &mut Self where
F: 'static + RPCCommand<T> + Clone,
pub fn start(&'a mut self)
Trait Implementations
Auto Trait Implementations
impl<T> !RefUnwindSafe for Plugin<T>
impl<T> !Send for Plugin<T>
impl<T> !Sync for Plugin<T>
impl<T> Unpin for Plugin<T> where
T: Unpin,
impl<T> !UnwindSafe for Plugin<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more