Trait zsh_module::Actions

source ·
pub trait Actions: Downcast {
    fn boot(&mut self) -> Result<()>;
    fn cleanup(&mut self) -> Result<()>;
}
Expand description

This trait allows for defining behaviour to be enacted on parts of the zsh module lifecycle.

Refer to each method for a description of when it is called

Required Methods§

This method is called right after setup().

If this returns Err, loading is cancelled and Self::cleanup is not called.

This method is only called if the module was successfully loaded.

An Err result means the module is not ready to unload yet. However, zsh will ignore this if it is exiting.

Implementations§

Returns true if the trait object wraps an object of type __T.

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

Implementors§