pub struct CoreBuilder<T, W, C, F> { /* private fields */ }
Expand description
The actual provided Builder
implementation.
The various type parameters are used to swap out atomic/non-atomic AST versions.
Implementations§
Source§impl<T, W, C, F> CoreBuilder<T, W, C, F>
impl<T, W, C, F> CoreBuilder<T, W, C, F>
Trait Implementations§
Source§impl<T, W, C, F> Builder for CoreBuilder<T, W, C, F>where
T: From<String>,
W: From<ShellWord<T, W, C>>,
C: From<Command<AndOrList<ListableCommand<PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<ShellCompoundCommand<T, W, C>>, F>>>>>,
F: From<ShellCompoundCommand<T, W, C>>,
impl<T, W, C, F> Builder for CoreBuilder<T, W, C, F>where
T: From<String>,
W: From<ShellWord<T, W, C>>,
C: From<Command<AndOrList<ListableCommand<PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<ShellCompoundCommand<T, W, C>>, F>>>>>,
F: From<ShellCompoundCommand<T, W, C>>,
Source§fn complete_command(
&mut self,
_pre_cmd_comments: Vec<Newline>,
list: Self::CommandList,
separator: SeparatorKind,
_cmd_comment: Option<Newline>,
) -> Result<Self::Command, Self::Error>
fn complete_command( &mut self, _pre_cmd_comments: Vec<Newline>, list: Self::CommandList, separator: SeparatorKind, _cmd_comment: Option<Newline>, ) -> Result<Self::Command, Self::Error>
Constructs a Command::Job
node with the provided inputs if the command
was delimited by an ampersand or the command itself otherwise.
Source§fn and_or_list(
&mut self,
first: Self::ListableCommand,
rest: Vec<(Vec<Newline>, AndOr<Self::ListableCommand>)>,
) -> Result<Self::CommandList, Self::Error>
fn and_or_list( &mut self, first: Self::ListableCommand, rest: Vec<(Vec<Newline>, AndOr<Self::ListableCommand>)>, ) -> Result<Self::CommandList, Self::Error>
Constructs a Command::List
node with the provided inputs.
Source§fn pipeline(
&mut self,
bang: bool,
cmds: Vec<(Vec<Newline>, Self::PipeableCommand)>,
) -> Result<Self::ListableCommand, Self::Error>
fn pipeline( &mut self, bang: bool, cmds: Vec<(Vec<Newline>, Self::PipeableCommand)>, ) -> Result<Self::ListableCommand, Self::Error>
Constructs a Command::Pipe
node with the provided inputs or a Command::Simple
node if only a single command with no status inversion is supplied.
Source§fn simple_command(
&mut self,
redirects_or_env_vars: Vec<RedirectOrEnvVar<Self::Redirect, String, Self::Word>>,
redirects_or_cmd_words: Vec<RedirectOrCmdWord<Self::Redirect, Self::Word>>,
) -> Result<Self::PipeableCommand, Self::Error>
fn simple_command( &mut self, redirects_or_env_vars: Vec<RedirectOrEnvVar<Self::Redirect, String, Self::Word>>, redirects_or_cmd_words: Vec<RedirectOrCmdWord<Self::Redirect, Self::Word>>, ) -> Result<Self::PipeableCommand, Self::Error>
Constructs a Command::Simple
node with the provided inputs.
Source§fn brace_group(
&mut self,
cmd_group: CommandGroup<Self::Command>,
redirects: Vec<Self::Redirect>,
) -> Result<Self::CompoundCommand, Self::Error>
fn brace_group( &mut self, cmd_group: CommandGroup<Self::Command>, redirects: Vec<Self::Redirect>, ) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Brace
node with the provided inputs.
Source§fn subshell(
&mut self,
cmd_group: CommandGroup<Self::Command>,
redirects: Vec<Self::Redirect>,
) -> Result<Self::CompoundCommand, Self::Error>
fn subshell( &mut self, cmd_group: CommandGroup<Self::Command>, redirects: Vec<Self::Redirect>, ) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Subshell
node with the provided inputs.
Source§fn loop_command(
&mut self,
kind: LoopKind,
guard_body_pair: GuardBodyPairGroup<Self::Command>,
redirects: Vec<Self::Redirect>,
) -> Result<Self::CompoundCommand, Self::Error>
fn loop_command( &mut self, kind: LoopKind, guard_body_pair: GuardBodyPairGroup<Self::Command>, redirects: Vec<Self::Redirect>, ) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Loop
node with the provided inputs.
Source§fn if_command(
&mut self,
fragments: IfFragments<Self::Command>,
redirects: Vec<Self::Redirect>,
) -> Result<Self::CompoundCommand, Self::Error>
fn if_command( &mut self, fragments: IfFragments<Self::Command>, redirects: Vec<Self::Redirect>, ) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::If
node with the provided inputs.
Source§fn for_command(
&mut self,
fragments: ForFragments<Self::Word, Self::Command>,
redirects: Vec<Self::Redirect>,
) -> Result<Self::CompoundCommand, Self::Error>
fn for_command( &mut self, fragments: ForFragments<Self::Word, Self::Command>, redirects: Vec<Self::Redirect>, ) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::For
node with the provided inputs.
Source§fn case_command(
&mut self,
fragments: CaseFragments<Self::Word, Self::Command>,
redirects: Vec<Self::Redirect>,
) -> Result<Self::CompoundCommand, Self::Error>
fn case_command( &mut self, fragments: CaseFragments<Self::Word, Self::Command>, redirects: Vec<Self::Redirect>, ) -> Result<Self::CompoundCommand, Self::Error>
Constructs a CompoundCommand::Case
node with the provided inputs.
Source§fn compound_command_into_pipeable(
&mut self,
cmd: Self::CompoundCommand,
) -> Result<Self::PipeableCommand, Self::Error>
fn compound_command_into_pipeable( &mut self, cmd: Self::CompoundCommand, ) -> Result<Self::PipeableCommand, Self::Error>
Converts a CompoundCommand
into a PipeableCommand
.
Source§fn function_declaration(
&mut self,
name: String,
_post_name_comments: Vec<Newline>,
body: Self::CompoundCommand,
) -> Result<Self::PipeableCommand, Self::Error>
fn function_declaration( &mut self, name: String, _post_name_comments: Vec<Newline>, body: Self::CompoundCommand, ) -> Result<Self::PipeableCommand, Self::Error>
Constructs a Command::FunctionDef
node with the provided inputs.
Source§fn comments(&mut self, _comments: Vec<Newline>) -> Result<(), Self::Error>
fn comments(&mut self, _comments: Vec<Newline>) -> Result<(), Self::Error>
Ignored by the builder.
Source§fn word(
&mut self,
kind: ComplexWordKind<Self::Command>,
) -> Result<Self::Word, Self::Error>
fn word( &mut self, kind: ComplexWordKind<Self::Command>, ) -> Result<Self::Word, Self::Error>
Constructs a ast::Word
from the provided input.
Source§fn redirect(
&mut self,
kind: RedirectKind<Self::Word>,
) -> Result<Self::Redirect, Self::Error>
fn redirect( &mut self, kind: RedirectKind<Self::Word>, ) -> Result<Self::Redirect, Self::Error>
Constructs a ast::Redirect
from the provided input.
Source§type CommandList = AndOrList<<CoreBuilder<T, W, C, F> as Builder>::ListableCommand>
type CommandList = AndOrList<<CoreBuilder<T, W, C, F> as Builder>::ListableCommand>
Source§type ListableCommand = ListableCommand<<CoreBuilder<T, W, C, F> as Builder>::PipeableCommand>
type ListableCommand = ListableCommand<<CoreBuilder<T, W, C, F> as Builder>::PipeableCommand>
Source§type PipeableCommand = PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<CompoundCommand<CompoundCommandKind<T, W, C>, Redirect<W>>>, F>
type PipeableCommand = PipeableCommand<T, Box<SimpleCommand<T, W, Redirect<W>>>, Box<CompoundCommand<CompoundCommandKind<T, W, C>, Redirect<W>>>, F>
Source§type CompoundCommand = CompoundCommand<CompoundCommandKind<T, <CoreBuilder<T, W, C, F> as Builder>::Word, <CoreBuilder<T, W, C, F> as Builder>::Command>, Redirect<<CoreBuilder<T, W, C, F> as Builder>::Word>>
type CompoundCommand = CompoundCommand<CompoundCommandKind<T, <CoreBuilder<T, W, C, F> as Builder>::Word, <CoreBuilder<T, W, C, F> as Builder>::Command>, Redirect<<CoreBuilder<T, W, C, F> as Builder>::Word>>
if
, case
, for
, etc.