[][src]Trait weechat::hooks::CommandRunCallback

pub trait CommandRunCallback {
    fn callback(
        &mut self,
        weechat: &Weechat,
        buffer: &Buffer<'_>,
        command: Cow<'_, str>
    ) -> ReturnCode; }

Trait for the command-run callback

A blanket implementation for pure FnMut functions exists, if data needs to be passed to the callback implement this over your struct.

Required methods

fn callback(
    &mut self,
    weechat: &Weechat,
    buffer: &Buffer<'_>,
    command: Cow<'_, str>
) -> ReturnCode

Callback that will be called when the command is ran.

Should return a code signaling if further command callbacks should be ran or if the command should be "eaten" by this callback.

Arguments

  • weechat - A Weechat context.

  • buffer - The buffer that received the command.

  • command - The full command that was executed, including its arguments.

Loading content...

Implementors

impl<T: FnMut(&Weechat, &Buffer<'_>, Cow<'_, str>) -> ReturnCode + 'static> CommandRunCallback for T[src]

Loading content...