charon_lib::options

Struct CliOpts

source
pub struct CliOpts {
Show 27 fields pub ullbc: bool, pub lib: bool, pub bin: Option<String>, pub mir_promoted: bool, pub mir_optimized: bool, pub crate_name: Option<String>, pub input_file: Option<PathBuf>, pub dest_dir: Option<PathBuf>, pub dest_file: Option<PathBuf>, pub use_polonius: bool, pub no_code_duplication: bool, pub extract_opaque_bodies: bool, pub include: Vec<String>, pub opaque: Vec<String>, pub exclude: Vec<String>, pub hide_marker_traits: bool, pub no_cargo: bool, pub rustc_args: Vec<String>, pub cargo_args: Vec<String>, pub abort_on_error: bool, pub error_on_warnings: bool, pub no_serialize: bool, pub print_original_ullbc: bool, pub print_ullbc: bool, pub print_built_llbc: bool, pub print_llbc: bool, pub no_merge_goto_chains: bool,
}

Fields§

§ullbc: bool

Extract the unstructured LLBC (i.e., don’t reconstruct the control-flow)

§lib: bool

Compile the package’s library

§bin: Option<String>

Compile the specified binary

§mir_promoted: bool

Extract the promoted MIR instead of the built MIR

§mir_optimized: bool

Extract the optimized MIR instead of the built MIR

§crate_name: Option<String>

Provide a custom name for the compiled crate (ignore the name computed by Cargo)

§input_file: Option<PathBuf>

The input file (the entry point of the crate to extract). This is needed if you want to define a custom entry point (to only extract part of a crate for instance).

§dest_dir: Option<PathBuf>

The destination directory. Files will be generated as <dest_dir>/<crate_name>.{u}llbc, unless dest_file is set. dest_dir defaults to the current directory.

§dest_file: Option<PathBuf>

The destination file. By default <dest_dir>/<crate_name>.llbc. If this is set we ignore dest_dir.

§use_polonius: bool

If activated, use Polonius’ non-lexical lifetimes (NLL) analysis. Otherwise, use the standard borrow checker.

§no_code_duplication: bool§extract_opaque_bodies: bool

Usually we skip the bodies of foreign methods and structs with private fields. When this flag is on, we don’t.

§include: Vec<String>

Whitelist of items to translate. These use the name-matcher syntax.

§opaque: Vec<String>

Blacklist of items to keep opaque. These use the name-matcher syntax.

§exclude: Vec<String>

Blacklist of items to not translate at all. These use the name-matcher syntax.

§hide_marker_traits: bool

Whether to hide the Sized, Sync, Send and Unpin marker traits anywhere they show up.

§no_cargo: bool

Do not run cargo; instead, run the driver directly.

§rustc_args: Vec<String>

Extra flags to pass to rustc.

§cargo_args: Vec<String>

Extra flags to pass to cargo. Incompatible with --no-cargo.

§abort_on_error: bool

Panic on the first error. This is useful for debugging.

§error_on_warnings: bool

Print the errors as warnings

§no_serialize: bool§print_original_ullbc: bool§print_ullbc: bool§print_built_llbc: bool§print_llbc: bool§no_merge_goto_chains: bool

Implementations§

source§

impl CliOpts

source

pub fn validate(&self)

Check that the options are meaningful

Trait Implementations§

source§

impl Args for CliOpts

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Clone for CliOpts

source§

fn clone(&self) -> CliOpts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CommandFactory for CliOpts

source§

fn command<'b>() -> Command

Build a [Command] that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a [Command] that can update self. Read more
source§

impl Debug for CliOpts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for CliOpts

source§

fn default() -> CliOpts

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for CliOpts

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl FromArgMatches for CliOpts

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

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>

Assign values from ArgMatches to self.
source§

impl Parser for CliOpts

§

fn parse() -> Self

Parse from std::env::args_os(), [exit][Error::exit] on error.
§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, [exit][Error::exit] on error.
§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, [exit][Error::exit] on error.
§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
source§

impl Serialize for CliOpts

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<I, T> ExtractContext<I, ()> for T

§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<I> RecreateContext<I> for I

§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,