Skip to main content

Crate wslcsdk

Crate wslcsdk 

Source
Expand description

Microsoft.WSL.Containers (WSLC) 官方 SDK 安全 Rust 抽象门面

基于官方 3.0.1 GA SDK 构建,提供具备 RAII 自动资源释放、强类型错误模型与并发安全保障的统一客户端接口。

§平台要求

本 crate 深度依赖 Win32 COM/RPC 与系统组件 wslcsdk.dll,仅支持 Windows 平台。 在非 Windows 目标上编译会立即得到一条明确的 compile_error! 提示, 而非在 std::os::windows 等处报出难以定位的错误。

Re-exports§

pub use channel::AsyncReceiver;Windows
pub use channel::AsyncRecvError;Windows
pub use client::WslcClient;Windows
pub use client::WslcClientBuilder;Windows
pub use com::ComGuard;Windows
pub use com::ProcessMtaGuard;Windows
pub use com::init_process_mta;Windows
pub use com::try_initialize_mta;Windows
pub use com::with_mta;Windows
pub use com_memory::ComAnsiString;Windows
pub use com_memory::ComArray;Windows
pub use com_memory::ComWideString;Windows
pub use container::ContainerBuilder;Windows
pub use container::ContainerPortMappingData;Windows
pub use container::WslcContainerHandle;Windows
pub use error::WslcDomainError;Windows
pub use error::WslcError;Windows
pub use image::ImageInfo;Windows
pub use image::ImageProgress;Windows
pub use image::OwnedImageProgress;Windows
pub use image::WslcImageManager;Windows
pub use process::ProcessBuilder;Windows
pub use process::ProcessStreams;Windows
pub use process::WslcProcessHandle;Windows
pub use registry::AuthTokenResult;Windows
pub use registry::WslcRegistryManager;Windows
pub use session::CrashDumpSubscription;Windows
pub use session::SessionBuilder;Windows
pub use session::WslcSessionHandle;Windows
pub use session::default_session_root;Windows
pub use system::WslcSystem;Windows
pub use volume::VhdVolumeOptions;Windows
pub use volume::WslcVolumeManager;Windows

Modules§

async_opsWindows
面向 Tokio 运行时的异步非阻塞扩展
channelWindows
异步有界通道接收端的安全包装
clientWindows
WSLC 统一高层门面客户端
comWindows
Windows COM 多线程套间 (MTA) RAII 守卫与进程级上下文管理
com_memoryWindows
由 COM 堆分配的原始指针的 RAII 托管
containerWindows
WSLC 容器设置建造者与容器生命周期控制
errorWindows
WSLC 安全错误类型与 Win32 HRESULT 解析器
imageWindows
WSLC 镜像枚举、远程拉取、推送与归档载入
processWindows
WSLC 容器内进程创建、信号分发与标准 I/O 交互
registryWindows
WSLC 镜像仓库鉴权与 Identity Token 生成
sessionWindows
WSLC 会话生命周期管理
systemWindows
WSLC 系统服务门面:版本查询、组件缺失检测与依赖安装
volumeWindows
WSLC 会话持久化 VHD 存储卷管理

Structs§

WslcContainerPortMappingWindows
容器端口映射配置
WslcVersionWindows
WSLC 系统版本号

Enums§

WslcContainerNetworkingModeWindows
容器网络模式
WslcContainerStateWindows
容器运行状态
WslcIdentityTokenTypeWindows
身份认证令牌返回类型
WslcImageProgressStatusWindows
镜像拉取进度阶段状态
WslcPortProtocolWindows
端口映射协议类型
WslcProcessIOHandleWindows
进程标准 IO 流类型
WslcProcessStateWindows
进程运行状态
WslcSessionTerminationReasonWindows
会话退出原因枚举
WslcSignalWindows
Linux 信号枚举
WslcVhdTypeWindows
VHD 虚拟磁盘分配类型

Constants§

WSLC_E_BASEWindows
WSLC 基础错误偏移码 (0x0600)
WSLC_E_CONTAINER_DELETEDWindows
容器已被删除 (0x80040613)
WSLC_E_CONTAINER_DISABLEDWindows
容器功能被系统或安全策略禁用 (0x8004060C)
WSLC_E_CONTAINER_IS_RUNNINGWindows
容器已处于运行状态 (0x80040606)
WSLC_E_CONTAINER_NOT_FOUNDWindows
容器未找到 (0x80040603)
WSLC_E_CONTAINER_NOT_RUNNINGWindows
容器当前未处于运行状态 (0x80040605)
WSLC_E_CONTAINER_PREFIX_AMBIGUOUSWindows
容器 ID 前缀存在歧义,匹配到多个容器 (0x80040602)
WSLC_E_EVENTS_LOSTWindows
事件队列溢出,部分事件已丢失 (0x80040611)
WSLC_E_EVENT_STREAM_FINISHEDWindows
事件流已传输完毕 (0x80040612)
WSLC_E_IMAGE_NOT_FOUNDWindows
镜像未找到 (0x80040601)
WSLC_E_INVALID_SESSION_NAMEWindows
会话名称格式不合法 (0x80040608)
WSLC_E_NETWORK_NOT_FOUNDWindows
网络未找到 (0x80040609)
WSLC_E_REGISTRY_BLOCKED_BY_POLICYWindows
镜像仓库访问被安全策略拦截 (0x8004060D)
WSLC_E_SDK_UPDATE_NEEDEDWindows
SDK 版本落后,需要更新 (0x8004060B)
WSLC_E_SESSION_NOT_FOUNDWindows
会话未找到 (0x8004060F)
WSLC_E_SESSION_RESERVEDWindows
会话名称属于系统保留名称,不可使用 (0x80040607)
WSLC_E_VM_NOT_RUNNINGWindows
WSL 虚拟机未在运行 (0x80040610)
WSLC_E_VOLUME_NOT_AVAILABLEWindows
存储卷当前不可用或被独占占用 (0x8004060E)
WSLC_E_VOLUME_NOT_FOUNDWindows
卷未找到 (0x80040604)
WSLC_E_WU_SEARCH_FAILEDWindows
Windows Update 搜索依赖组件失败 (0x8004060A)

Type Aliases§

WslcComponentFlagsWindows
系统缺失组件标志位
WslcContainerFlagsWindows
容器特性标志位
WslcContainerStartFlagsWindows
容器启动标志位
WslcDeleteContainerFlagsWindows
容器删除标志位
WslcInstallOptionsWindows
组件安装选项标志位
WslcProcessFlagsWindows
进程选项标志位
WslcSessionFeatureFlagsWindows
会话特性标志位
WslcVhdRequirementsFlagsWindows
VHD 要求标志位