Skip to main content

Crate vce

Crate vce 

Source
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.
AuditCategory
One Windows audit-policy category.
AuthorizationData
Opaque authorization data attached to an object.
CommandOutput
The captured result of one command submitted to a Session.
Configuration
Privileged machine configuration for an embedding application.
CreateOptions
Initial owner and authorization data for a newly created object.
DetachedNamespace
A handle to a detached namespace.
Engine
The virtual computing Engine: state, events, authorization, and time.
EventData
A generic key/value payload attached to an event.
FileMetadata
Public Unix file metadata.
FileMode
A Unix permission mode: the rwx bits for owner, group, and other, plus the setuid, setgid, and sticky bits.
FirewallRule
Public firewall-rule state.
Group
Public group state.
Id
A strongly typed identifier over a u64 value.
Machine
A booted, stateful VCE machine.
MachineBuilder
Builds a deterministic VCE machine.
Metadata
Metadata for an Engine object.
MetadataPatch
A set of metadata changes to apply atomically.
Name
The name of an object, as stored in its metadata.
ObjectEvent
A single event in the Engine’s synchronous event chain.
PasswordPolicy
Windows password and account-lockout policy.
Process
Public process state read from the selected OS’s process namespace.
RegistryValue
One Windows registry value from the real hive-file tree.
Service
Public service state.
Session
A running shell session against a booted OS.
SessionControl
A thread-safe cooperative control handle for a running session.
SubscriptionId
The identity of an EventBus subscription.
Timestamp
A point in virtual time, in nanoseconds since the virtual epoch.
VirtualPath
An absolute, normalized virtual path.

Enums§

AccessClass
The three Unix permission classes.
Capability
A semantic feature exposed by a machine profile’s structured API.
EngineError
The error type for all Engine operations.
EventType
The kind of an ObjectEvent.
MachineError
An error from the supported VCE embedding API.
MetadataValue
A generic metadata value for the extensible key/value store.
ObjectKind
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.
PreferenceValue
A scalar value in a macOS preference plist.
SessionError
Why a session could not be built.
SessionInterruption
The distinct reason cooperative session execution stopped.
SessionOutcome
The outcome of a cooperatively controlled interactive or line session.
ShellChoice
Which shell a session runs.

Type Aliases§

ActorId
The identity of an actor (a principal) that performs Engine operations.
ObjectId
The identity of an Engine object.