Struct zsh_module::Builtin
source · pub struct Builtin<'a, C, A>where
C: Cmd<A>,{ /* private fields */ }Expand description
Properties of a zsh builtin command
Any chages will reflect on the behaviour of the builtin
Implementations§
source§impl<'a, A, C> Builtin<'a, C, A>where
A: Actions,
C: Cmd<A> + 'static,
impl<'a, A, C> Builtin<'a, C, A>where
A: Actions,
C: Cmd<A> + 'static,
sourcepub fn new(name: &'static str, cb: C) -> Self
pub fn new(name: &'static str, cb: C) -> Self
Creates a command builtin.
By default, the builtin can take any amount of arguments (minargs and maxargs are 0 and None, respectively) and no flags.
sourcepub fn minargs(self, value: i32) -> Self
pub fn minargs(self, value: i32) -> Self
Sets the minimum amount of arguments allowed by the builtin
Auto Trait Implementations§
impl<'a, C, A> RefUnwindSafe for Builtin<'a, C, A>where
A: RefUnwindSafe,
C: RefUnwindSafe,
impl<'a, C, A> Send for Builtin<'a, C, A>where
A: Send,
C: Send,
impl<'a, C, A> Sync for Builtin<'a, C, A>where
A: Sync,
C: Sync,
impl<'a, C, A> Unpin for Builtin<'a, C, A>where
A: Unpin,
C: Unpin,
impl<'a, C, A> UnwindSafe for Builtin<'a, C, A>where
A: UnwindSafe,
C: UnwindSafe,
Blanket Implementations§
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.