zlayer_gcs/lib.rs
1//! GCS (Guest Compute Service) bridge for Windows Hyper-V utility VMs.
2//!
3//! Host-side library that connects to a running UVM's in-guest GCS over an
4//! hvsock (Hyper-V virtual socket), negotiates the GCS protocol, and
5//! dispatches RPCs (`CreateContainer`, `ExecuteProcess`, `ModifySettings`, ...).
6//!
7//! Mirrors hcsshim's `internal/gcs/{guestconnection.go, container.go,
8//! prot/protocol.go}` Go reference implementation.
9//!
10//! All FFI sits behind `#[cfg(target_os = "windows")]` — the crate compiles
11//! cleanly on non-Windows hosts (with the public types stubbed) so the rest
12//! of the workspace stays buildable on Linux/`macOS` dev boxes.
13
14#![cfg_attr(not(target_os = "windows"), allow(dead_code, unused_imports))]
15#![deny(rust_2018_idioms)]
16#![warn(clippy::pedantic, clippy::nursery)]
17#![allow(
18 clippy::module_name_repetitions,
19 clippy::missing_errors_doc,
20 clippy::missing_panics_doc
21)]
22
23pub mod bridge;
24pub mod diagnostics;
25pub mod error;
26pub mod frame;
27/// Host-side receiver for the in-guest GCS log-forward stream.
28///
29/// Only meaningful (non-empty) on Windows with the `windows-debug` feature;
30/// see the module docs for the hcsshim mechanism it mirrors.
31#[cfg(all(target_os = "windows", feature = "windows-debug"))]
32pub mod log_forward;
33pub mod protocol;
34pub mod transport;
35
36pub use error::{GcsError, GcsResult};
37
38#[cfg(test)]
39mod tests {
40 #[test]
41 fn crate_exports_compile() {
42 // Just ensures every public symbol typechecks.
43 let _: super::GcsError = std::io::Error::other("x").into();
44 }
45}