Skip to main content

Module decorators

Module decorators 

Source
Expand description

Decorator-like convenience helpers.

Python Click exposes a decorator factory make_pass_decorator() that creates decorators to pass a context object (stored on Context.obj) into callbacks.

Rust doesn’t have function decorators, so click-rs provides a small adapter that converts a function Fn(&T, &Context) into a standard CommandCallback (Fn(&Context)), looking up T from the context.

Structs§

PassDecorator
A decorator factory for passing a context object of type T to a callback.

Functions§

make_pass_decorator
Create a pass-decorator for T.