Skip to main content

ProgramCollect

Trait ProgramCollect 

Source
pub trait ProgramCollect {
    type Enum;
    type ErrorDispatcherNotFound: Groupped<Self::Enum>;
    type ErrorRendererNotFound: Groupped<Self::Enum>;
    type ResultEmpty: Groupped<Self::Enum>;

    // Required methods
    fn build_renderer_not_found(member_id: Self::Enum) -> AnyOutput<Self::Enum>;
    fn build_dispatcher_not_found(args: Vec<String>) -> AnyOutput<Self::Enum>;
    fn build_empty_result() -> AnyOutput<Self::Enum>;
    fn render(any: AnyOutput<Self::Enum>, r: &mut RenderResult);
    fn render_help(any: AnyOutput<Self::Enum>, r: &mut RenderResult);
    fn do_chain(any: AnyOutput<Self::Enum>) -> ChainProcess<Self::Enum>;
    fn do_comp(any: &AnyOutput<Self::Enum>, ctx: &ShellContext) -> Suggest;
    fn has_renderer(any: &AnyOutput<Self::Enum>) -> bool;
    fn has_chain(any: &AnyOutput<Self::Enum>) -> bool;
    fn general_render(
        any: AnyOutput<Self::Enum>,
        setting: &GeneralRendererSetting,
    ) -> Result<RenderResult, GeneralRendererSerializeError>;
}
Expand description

Collected program context

Note: It is recommended to use the gen_program!() macro from mingling_macros to automatically create this type

Required Associated Types§

Source

type Enum

Enum type representing internal IDs for the program

Source

type ErrorDispatcherNotFound: Groupped<Self::Enum>

Source

type ErrorRendererNotFound: Groupped<Self::Enum>

Source

type ResultEmpty: Groupped<Self::Enum>

Required Methods§

Source

fn build_renderer_not_found(member_id: Self::Enum) -> AnyOutput<Self::Enum>

Build an AnyOutput to indicate that a renderer was not found

Source

fn build_dispatcher_not_found(args: Vec<String>) -> AnyOutput<Self::Enum>

Build an AnyOutput to indicate that a dispatcher was not found

Source

fn build_empty_result() -> AnyOutput<Self::Enum>

Build an AnyOutput to indicate that the chain returned an empty result

Source

fn render(any: AnyOutput<Self::Enum>, r: &mut RenderResult)

Render the input AnyOutput

Source

fn render_help(any: AnyOutput<Self::Enum>, r: &mut RenderResult)

Render help for Entry

Source

fn do_chain(any: AnyOutput<Self::Enum>) -> ChainProcess<Self::Enum>

Find a matching chain to continue execution based on the input AnyOutput, returning a new AnyOutput

Source

fn do_comp(any: &AnyOutput<Self::Enum>, ctx: &ShellContext) -> Suggest

Match and execute specific completion logic based on any Entry

Source

fn has_renderer(any: &AnyOutput<Self::Enum>) -> bool

Whether the program has a renderer that can handle the current AnyOutput

Source

fn has_chain(any: &AnyOutput<Self::Enum>) -> bool

Whether the program has a chain that can handle the current AnyOutput

Source

fn general_render( any: AnyOutput<Self::Enum>, setting: &GeneralRendererSetting, ) -> Result<RenderResult, GeneralRendererSerializeError>

Perform general rendering and presentation of any type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§