Skip to main content

version_print/
version_print.rs

1//! Example: the smallest useful host. Create the engine, say what it is, exit.
2//!
3//! ```text
4//! cargo run --example version_print
5//! ```
6//!
7//! Every other example builds something or runs something. This one shows the
8//! floor: the shortest path from `cargo add rs-teststand` to a process that has
9//! really talked to the engine. It touches what any host must touch, meaning a
10//! COM apartment, the engine coclass, one property read and an orderly
11//! teardown, and nothing beyond that.
12//!
13//! For what the same program costs once built and deployed, see the standalone
14//! application in `examples/version-printer/`, which carries the release profile
15//! and the measured binary sizes.
16
17use rs_teststand::{Engine, Error};
18
19fn main() -> Result<(), Error> {
20    let engine = Engine::new()?;
21
22    println!("version : {}", engine.version_string()?);
23    println!(
24        "numeric : {}.{}.{} build {}",
25        engine.major_version()?,
26        engine.minor_version()?,
27        engine.revision_version()?,
28        engine.build_version()?
29    );
30    println!("bitness : {}", if engine.is_64bit()? { 64 } else { 32 });
31    println!("install : {}", engine.teststand_directory()?);
32
33    Ok(())
34}