pub(crate) struct Args {
pub(crate) path: PathBuf,
pub(crate) bin: bool,
pub(crate) out: PathBuf,
}
Expand description
A compiler for Paralegal’s Controlled Natural Language (CNL) policies.
By default this generates a Rust namespace (mod
) that contains a function
check
which, when called, enforces your policy. You should use the
framework in
paralegal_policy
to create a suitable binary that calls this function. It depends on the
crates paralegal_policy
and anyhow
.
Alternatively you may use the --bin
argument, which will instead create a
Rust source file with a main
function and necessary boilerplate to call
the policy. The file created with this method additionally depends on the
clap
crate with the derive
feature enabled.
Fields§
§path: PathBuf
Path to the policy file.
bin: bool
Also generate boilerplate for a runnable policy. The output file
contains a main
function that runs both the PDG generation as well as
the policy.
out: PathBuf
Name of the output file.
Trait Implementations§
Source§impl Args for Args
impl Args for Args
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
Command
so it can instantiate self
via
FromArgMatches::update_from_arg_matches_mut
Read moreSource§impl CommandFactory for Args
impl CommandFactory for Args
Source§impl FromArgMatches for Args
impl FromArgMatches for Args
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>
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>
ArgMatches
to self
.