pub struct Cli {
pub command: Commands,
pub cwd: Option<PathBuf>,
}Expand description
A CLI for generating typed Rust code from Gel queries. This is available as library code in case you want to further customize the generated output.
Fields§
§command: Commands§cwd: Option<PathBuf>Optional working directory to run the command from.
Implementations§
Source§impl Cli
impl Cli
Sourcepub async fn run(&self) -> GelxCoreResult<()>
pub async fn run(&self) -> GelxCoreResult<()>
Runs the CLI.
Sourcepub async fn outputs(
metadata: &GelxMetadata,
root_path: impl AsRef<Path>,
) -> GelxCoreResult<ModuleOutputs>
pub async fn outputs( metadata: &GelxMetadata, root_path: impl AsRef<Path>, ) -> GelxCoreResult<ModuleOutputs>
Generates the module outputs from the queries in the current directory.
Sourcepub async fn generate(
metadata: &GelxMetadata,
root_path: impl AsRef<Path>,
json: bool,
) -> GelxCoreResult<()>
pub async fn generate( metadata: &GelxMetadata, root_path: impl AsRef<Path>, json: bool, ) -> GelxCoreResult<()>
Generates Rust code from the crate in the current directory.
Sourcepub async fn check(
metadata: &GelxMetadata,
root_path: impl AsRef<Path>,
) -> GelxCoreResult<()>
pub async fn check( metadata: &GelxMetadata, root_path: impl AsRef<Path>, ) -> GelxCoreResult<()>
Checks if the generated Rust code is up-to-date
Trait Implementations§
Source§impl Args for Cli
impl Args for Cli
Source§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
Source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Append to
Command so it can instantiate self via
FromArgMatches::update_from_arg_matches_mut Read moreSource§impl CommandFactory for Cli
impl CommandFactory for Cli
Source§impl FromArgMatches for Cli
impl FromArgMatches for Cli
Source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
Source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
Source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
Assign values from
ArgMatches to self.Source§impl Parser for Cli
impl Parser for Cli
Source§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
Parse from iterator, exit on error.
Source§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
Parse from iterator, return Err on error.
Source§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
Auto Trait Implementations§
impl Freeze for Cli
impl RefUnwindSafe for Cli
impl Send for Cli
impl Sync for Cli
impl Unpin for Cli
impl UnwindSafe for Cli
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
Mutably borrows from an owned value. Read more