[−][src]Struct combu::hook::Hook
Hook is struct for action needs a context before sub.run.
Fields
name: String
name
action: Option<HookAction>
action
authors
copyright: String
copyright
license: Option<(String, String)>
license
description: Option<String>
description
usage: String
usage
alias: Vector<String>
alias
Implementations
impl Hook
[src]
pub fn new() -> Hook
[src]
Creates new hook.
pub fn with_name<T: Into<String>>(name: T) -> Hook
[src]
Creates new hook with name
pub fn with_all_field(
name: String,
action: Option<HookAction>,
authors: String,
copyright: String,
license: Option<(String, String)>,
description: Option<String>,
usage: String,
alias: Vector<String>
) -> Hook
[src]
name: String,
action: Option<HookAction>,
authors: String,
copyright: String,
license: Option<(String, String)>,
description: Option<String>,
usage: String,
alias: Vector<String>
) -> Hook
Creates new hook with all field
impl Hook
[src]
pub fn name<T: Into<String>>(self, name: T) -> Self
[src]
Sets name.
pub fn authors<T: Into<String>>(self, authors: T) -> Self
[src]
Sets authors.
pub fn copyright<T: Into<String>>(self, copyright: T) -> Self
[src]
Sets copyright.
pub fn usage<T: Into<String>>(self, usage: T) -> Self
[src]
Sets usage.
pub fn action(self, action: HookAction) -> Self
[src]
Sets action.
pub fn license(self, license: (String, String)) -> Self
[src]
Sets license.
pub fn description(self, description: String) -> Self
[src]
Sets description.
pub fn alias<T: Into<String>>(self, alias: T) -> Self
[src]
Add alias to this hook.
pub fn is(&self, name_or_alias: &str) -> bool
[src]
Beturns true if name_or_alias matches command's name or one of alias at leaast. name_or_aliasがコマンド名がエイリアスのうち少なくとも一つにマッチした場合trueを返す
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Hook
impl Send for Hook
impl Sync for Hook
impl Unpin for Hook
impl UnwindSafe for Hook
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,