pub struct DirectCompiler<Handle, Decoder = Parsed> { /* private fields */ }Expand description
Compiles a CLI program into the commands run on a Handle, their words read by a Decoder.
CliDirect reads words with Parsed; another interpretation that parses its own way compiles
with its own decoder. A context compiles its subtree with the compiler for the handle the
context answers.
Implementations§
Trait Implementations§
Source§impl<Handle, Decoder> CliCommandsAlg for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> CliCommandsAlg for DirectCompiler<Handle, Decoder>
Source§impl<Handle, Decoder, Operation, Sources, Mode> CliContextAlg<Operation, Sources, Mode> for DirectCompiler<Handle, Decoder>where
Handle: Send + 'static,
Decoder: 'static,
Operation: OperationAlg + ApplyAlg<Handle, Operation::Args> + Send + Sync + 'static,
Operation::Args: Send,
Sources: CliSources<Operation::Args> + CliDecodeSources<Operation::Args, Decoder, String> + Send + Sync + 'static,
Mode: CliOutcomeOf<Operation::Output> + Send + Sync + 'static,
Mode::Value: Send + 'static,
Mode::Error: Display + CliFailureAlg,
Applies a subtree’s commands to the handle the context operation answers.
impl<Handle, Decoder, Operation, Sources, Mode> CliContextAlg<Operation, Sources, Mode> for DirectCompiler<Handle, Decoder>where
Handle: Send + 'static,
Decoder: 'static,
Operation: OperationAlg + ApplyAlg<Handle, Operation::Args> + Send + Sync + 'static,
Operation::Args: Send,
Sources: CliSources<Operation::Args> + CliDecodeSources<Operation::Args, Decoder, String> + Send + Sync + 'static,
Mode: CliOutcomeOf<Operation::Output> + Send + Sync + 'static,
Mode::Value: Send + 'static,
Mode::Error: Display + CliFailureAlg,
Applies a subtree’s commands to the handle the context operation answers.
The global arguments are decoded with the command’s own, so a usage error is reported before the context is opened; a context that fails ends the run with its status.
Source§fn cli_inner(&self) -> Self::Inner
fn cli_inner(&self) -> Self::Inner
A context adds no path, so its subtree’s first layer is this one’s, selected alike.
Source§type Inner = DirectCompiler<<Mode as CliOutcomeOf<<Operation as ApplyAlg<Handle, <Operation as OperationAlg>::Args>>::Output>>::Value, Decoder>
type Inner = DirectCompiler<<Mode as CliOutcomeOf<<Operation as ApplyAlg<Handle, <Operation as OperationAlg>::Args>>::Output>>::Value, Decoder>
Source§type InnerCommands = Vec<Entry<<Mode as CliOutcomeOf<<Operation as ApplyAlg<Handle, <Operation as OperationAlg>::Args>>::Output>>::Value, Decoder>>
type InnerCommands = Vec<Entry<<Mode as CliOutcomeOf<<Operation as ApplyAlg<Handle, <Operation as OperationAlg>::Args>>::Output>>::Value, Decoder>>
Source§type Commands = Vec<Entry<Handle, Decoder>>
type Commands = Vec<Entry<Handle, Decoder>>
Source§fn cli_within(
&self,
operation: Operation,
sources: Sources,
mode: Mode,
commands: Self::InnerCommands,
) -> Self::Commands
fn cli_within( &self, operation: Operation, sources: Sources, mode: Mode, commands: Self::InnerCommands, ) -> Self::Commands
commands to the context operation answers from inputs.Source§impl<Handle, Decoder> CliNestAlg for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> CliNestAlg for DirectCompiler<Handle, Decoder>
Source§impl<Handle, Decoder, Operation, Sources, Mode> CliOperationAlg<Operation, Sources, Mode> for DirectCompiler<Handle, Decoder>where
Handle: Send + 'static,
Decoder: 'static,
Operation: OperationAlg + ApplyAlg<Handle, Operation::Args> + Send + Sync + 'static,
Operation::Args: Send,
Sources: CliSources<Operation::Args> + CliDecodeSources<Operation::Args, Decoder, String> + Send + Sync + 'static,
Mode: CliOutcomeOf<Operation::Output> + Send + Sync + 'static,
Mode::Value: DirectRender,
Mode::Error: Display + CliFailureAlg,
impl<Handle, Decoder, Operation, Sources, Mode> CliOperationAlg<Operation, Sources, Mode> for DirectCompiler<Handle, Decoder>where
Handle: Send + 'static,
Decoder: 'static,
Operation: OperationAlg + ApplyAlg<Handle, Operation::Args> + Send + Sync + 'static,
Operation::Args: Send,
Sources: CliSources<Operation::Args> + CliDecodeSources<Operation::Args, Decoder, String> + Send + Sync + 'static,
Mode: CliOutcomeOf<Operation::Output> + Send + Sync + 'static,
Mode::Value: DirectRender,
Mode::Error: Display + CliFailureAlg,
Source§fn cli_operation(
&self,
name: &'static str,
operation: Operation,
sources: Sources,
mode: Mode,
conventions: Conventions,
) -> Self::Commands
fn cli_operation( &self, name: &'static str, operation: Operation, sources: Sources, mode: Mode, conventions: Conventions, ) -> Self::Commands
operation under name, decoded through inputs from words read under
conventions, its output read under mode.Auto Trait Implementations§
impl<Handle, Decoder> Freeze for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> RefUnwindSafe for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> Send for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> Sync for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> Unpin for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> UnsafeUnpin for DirectCompiler<Handle, Decoder>
impl<Handle, Decoder> UnwindSafe for DirectCompiler<Handle, Decoder>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<This> CliDeclarationLawsExt<This> for This
impl<This> CliDeclarationLawsExt<This> for This
Source§fn law_cli_declaration<Operation, Sources, Mode, Commands>(
&self,
name: &'static str,
operation: Operation,
sources: Sources,
mode: Mode,
conventions: Conventions,
) -> Result<(), &'static str>where
This: CliOperationAlg<Operation, Sources, Mode, Commands = Commands> + CliCommandsObserved<Commands = Commands>,
Operation: OperationAlg,
Sources: CliSources<<Operation as OperationAlg>::Args>,
fn law_cli_declaration<Operation, Sources, Mode, Commands>(
&self,
name: &'static str,
operation: Operation,
sources: Sources,
mode: Mode,
conventions: Conventions,
) -> Result<(), &'static str>where
This: CliOperationAlg<Operation, Sources, Mode, Commands = Commands> + CliCommandsObserved<Commands = Commands>,
Operation: OperationAlg,
Sources: CliSources<<Operation as OperationAlg>::Args>,
Checks that operation declared under name with sources describes exactly that, with
one argument per operation argument, in order, and distinct spellings and positions.
Source§impl<This> CliOutcomeLawsExt<This> for This
impl<This> CliOutcomeLawsExt<This> for This
Source§impl<Source> CliPartsFor<ContextArg> for Source
impl<Source> CliPartsFor<ContextArg> for Source
Source§impl<This> CliProgramExt<This> for This
impl<This> CliProgramExt<This> for This
Source§fn compile_cli<Program>(
&self,
program: Program,
) -> <Program as CliProgramAlg<This>>::Commandswhere
Program: CliProgramAlg<This>,
fn compile_cli<Program>(
&self,
program: Program,
) -> <Program as CliProgramAlg<This>>::Commandswhere
Program: CliProgramAlg<This>,
Compiles a named CLI program with this interpreter.
impl<Source> CliStatedFor<ContextArg> for Source
Source§impl<This> ShapeProgramExt<This> for This
impl<This> ShapeProgramExt<This> for This
Source§fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
fn compile_shape<Program>(
&self,
program: Program,
) -> <Program as ShapeProgramAlg<This>>::Tywhere
Program: ShapeProgramAlg<This>,
Folds a declaration with this interpretation.