Struct feature_probe::Probe[][src]

pub struct Probe { /* fields omitted */ }

A probe object, which is used for probing for features.

Create this with ProbeProbeo::new, and then probe with one of the probing methods.

Methods

impl Probe
[src]

Creates a new Probe object with a default configuration.

In particular, it consults the environment variable "RUSTC" to determine what Rust compiler to use, and the environment variable "OUT_DIR" to determine where to put object files. If these are not set, they default to the values "rustc" and "target", respectively.

Panics

If the child rustc cannot be started or communicated with.

Examples

use feature_probe::Probe;

let probe = Probe::new();
assert!( probe.probe_type("u32") );

Probes for the existence of the given type by name.

Panics

If the child rustc cannot be started or communicated with.

Examples

use feature_probe::Probe;

let probe = Probe::new();
assert!(   probe.probe_type("u32") );
assert!( ! probe.probe_type("u512") );

Probes whether the given expression can be compiled.

Examples

use feature_probe::Probe;

let probe = Probe::new();
assert!(   probe.probe_expression("3 + 4") );
assert!( ! probe.probe_expression("3 + true") );

Probes for whether a whole program can be compiled.

Panics

If the child rustc cannot be started or communicated with.

Examples

use feature_probe::Probe;

let probe = Probe::new();
assert!(   probe.probe("fn main() { }") );
assert!( ! probe.probe("fn main(args: Vec<String>) { }") );

Probes for whether a whole program can be compiled.

Examples

use feature_probe::Probe;

let probe = Probe::new();
assert_eq!( probe.probe_result("fn main() { }").unwrap(),                  true );
assert_eq!( probe.probe_result("fn main(args: Vec<String>) { }").unwrap(), false );

Trait Implementations

impl Debug for Probe
[src]

Formats the value using the given formatter. Read more

impl Default for Probe
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl Send for Probe

impl Sync for Probe