Expand description
The VCE application as a library.
The playable virtual machine: boot an OS, authenticate, and run an
interactive (or line-mode) session against it. Exposing the session
machinery as a library lets separate applications built on VCE boot and
run the same machine the vce binary runs, with their own seeding and
observation around it.
Machine is the supported embedding boundary. It boots and retains an
OS, exposes privileged Configuration, generic Engine observation and
events, and creates authenticated Session values. A session can be
driven interactively, from a script, or one captured command at a time.
The vce binary and external applications therefore use the same OS and
shell behavior without depending on the workspace’s internal layer crates.
§Example
use vce::{FileMode, Machine, OsKind};
let machine = Machine::builder(OsKind::Linux)
.username("apiuser")
.hostname("example-host")
.build()?;
machine.configuration().write_file(
"/etc/example.conf",
b"enabled=yes\n",
FileMode::FILE_644,
)?;
let mut session = machine.session(None)?;
let output = session.execute("cat /etc/example.conf")?;
assert!(output.success());
assert_eq!(output.stdout_text(), "enabled=yes\n");Structs§
- Account
- Public account state, independent of VCE’s internal OS representation.
- Audit
Category - One Windows audit-policy category.
- Authorization
Data - Opaque authorization data attached to an object.
- Command
Output - The captured result of one command submitted to a
Session. - Configuration
- Privileged machine configuration for an embedding application.
- Create
Options - Initial owner and authorization data for a newly created object.
- Detached
Namespace - A handle to a detached namespace.
- Engine
- The virtual computing Engine: state, events, authorization, and time.
- Event
Data - A generic key/value payload attached to an event.
- File
Metadata - Public Unix file metadata.
- File
Mode - A Unix permission mode: the rwx bits for owner, group, and other, plus the setuid, setgid, and sticky bits.
- Firewall
Rule - Public firewall-rule state.
- Group
- Public group state.
- Id
- A strongly typed identifier over a
u64value. - Machine
- A booted, stateful VCE machine.
- Machine
Builder - Builds a deterministic VCE machine.
- Metadata
- Metadata for an Engine object.
- Metadata
Patch - A set of metadata changes to apply atomically.
- Name
- The name of an object, as stored in its metadata.
- Object
Event - A single event in the Engine’s synchronous event chain.
- Password
Policy - Windows password and account-lockout policy.
- Process
- Public process state read from the selected OS’s process namespace.
- Registry
Value - One Windows registry value from the real hive-file tree.
- Service
- Public service state.
- Session
- A running shell session against a booted OS.
- Session
Control - A thread-safe cooperative control handle for a running session.
- Subscription
Id - The identity of an
EventBussubscription. - Timestamp
- A point in virtual time, in nanoseconds since the virtual epoch.
- Virtual
Path - An absolute, normalized virtual path.
Enums§
- Access
Class - The three Unix permission classes.
- Capability
- A semantic feature exposed by a machine profile’s structured API.
- Engine
Error - The error type for all Engine operations.
- Event
Type - The kind of an
ObjectEvent. - Machine
Error - An error from the supported VCE embedding API.
- Metadata
Value - A generic metadata value for the extensible key/value store.
- Object
Kind - The kind of an Engine object.
- Operation
- An operation an actor may attempt on an object.
- OsError
- The error type for OS-layer operations.
- OsKind
- A supported virtual operating-system profile.
- Permission
- A permission that may be granted to a class.
- Preference
Value - A scalar value in a macOS preference plist.
- Session
Error - Why a session could not be built.
- Session
Interruption - The distinct reason cooperative session execution stopped.
- Session
Outcome - The outcome of a cooperatively controlled interactive or line session.
- Shell
Choice - Which shell a session runs.