Trait CliBindings

Source
pub trait CliBindings<Context: Context>: HandlerTypes {
    const NO_CLI: bool = false;

    // Required methods
    fn cli_command(&self) -> Command;
    fn cli_parse(
        &self,
        matches: &ArgMatches,
    ) -> Result<(VecDeque<&'static str>, Value), Error>;
    fn cli_display(
        &self,
        handle_args: HandlerArgsFor<Context, Self>,
        result: Self::Ok,
    ) -> Result<(), Self::Err>;
}

Provided Associated Constants§

Source

const NO_CLI: bool = false

Required Methods§

Source

fn cli_command(&self) -> Command

Source

fn cli_parse( &self, matches: &ArgMatches, ) -> Result<(VecDeque<&'static str>, Value), Error>

Source

fn cli_display( &self, handle_args: HandlerArgsFor<Context, Self>, result: Self::Ok, ) -> Result<(), Self::Err>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<Context, F, Fut, T, E, Args> CliBindings<Context> for FromFnAsync<F, Fut, T, E, Args>
where Context: Context, Self: HandlerTypes + PrintCliResult<Context>, Self::Params: CommandFactory + FromArgMatches + Serialize,

Source§

impl<Context, F, H, C> CliBindings<Context> for CustomDisplayFn<F, H, C>
where Context: Context, Self: HandlerTypes + PrintCliResult<Context>, Self::Params: CommandFactory + FromArgMatches + Serialize,

Source§

impl<Context, F, T, E, Args> CliBindings<Context> for FromFn<F, T, E, Args>
where Context: Context, Self: HandlerTypes + PrintCliResult<Context>, Self::Params: CommandFactory + FromArgMatches + Serialize,

Source§

impl<Context, H> CliBindings<Context> for NoCli<H>
where Context: Context, H: HandlerTypes,

Source§

const NO_CLI: bool = true

Source§

impl<Context, H> CliBindings<Context> for NoDisplay<H>
where Context: Context, Self: HandlerTypes + PrintCliResult<Context>, Self::Params: CommandFactory + FromArgMatches + Serialize,

Source§

impl<Context, M, H> CliBindings<Context> for WithAbout<M, H>
where Context: Context, H: CliBindings<Context>, M: IntoResettable<StyledStr> + Clone,

Source§

impl<Context, P, H> CliBindings<Context> for CustomDisplay<P, H>
where Context: Context, Self: HandlerTypes + PrintCliResult<Context>, Self::Params: CommandFactory + FromArgMatches + Serialize,

Source§

impl<Context, Params, InheritedParams> CliBindings<Context> for ParentHandler<Context, Params, InheritedParams>
where Context: Context, Params: FromArgMatches + CommandFactory + Serialize + Send + Sync + 'static, InheritedParams: Send + Sync + 'static,

Source§

impl<Context, Params, InheritedParams, H, F> CliBindings<Context> for InheritanceHandler<Params, InheritedParams, H, F>
where Context: Context, Params: Send + Sync + 'static, InheritedParams: Send + Sync + 'static, H: CliBindings<Context>, F: Fn(Params, InheritedParams) -> H::InheritedParams + Send + Sync + Clone + 'static,

Source§

impl<Context, RemoteContext, RemoteHandler, Extra> CliBindings<Context> for CallRemoteHandler<Context, RemoteContext, RemoteHandler, Extra>
where Context: Context, RemoteHandler: CliBindings<Context>, RemoteHandler::Params: Serialize, RemoteHandler::Ok: DeserializeOwned, RemoteHandler::Err: From<RpcError>, Extra: Send + Sync + 'static,