From 7f445ce82d4e4a1405e297670bb32122689990a9 Mon Sep 17 00:00:00 2001 From: sn99 Date: Tue, 21 Feb 2023 10:38:11 +0530 Subject: [PATCH] update examples mad remove main.rs --- Cargo.toml | 2 +- README.md | 5 +++-- src/lib.rs | 8 +++----- src/main.rs | 11 ----------- 4 files changed, 7 insertions(+), 19 deletions(-) delete mode 100644 src/main.rs diff --git a/Cargo.toml b/Cargo.toml index 7125d85..d39e752 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "query-wmi" -version = "1.0.0" +version = "1.1.0" edition = "2021" authors = ["sn99 "] description = "A crate to query WMI classes in Windows OS" diff --git a/README.md b/README.md index b715891..38cbbbb 100644 --- a/README.md +++ b/README.md @@ -15,12 +15,13 @@ https://learn.microsoft.com/en-us/windows/win32/wmisdk/wmi-start-page > Usage: ```rust +use query_wmi::{COMLibrary, Variant, WMIConnection}; use query_wmi::computer_hardware::{ - get_Win32_CDROMDrive, get_Win32_ComputerSystem, get_Win32_OperatingSystem, + get_Win32_CDROMDrive, get_Win32_ComputerSystem, get_Win32_PCMCIAController, get_Win32_PnPEntity, get_Win32_Processor, get_Win32_SystemEnclosure, get_Win32_TapeDrive, get_Win32_USBHub, }; -use wmi::COMLibrary; +use query_wmi::operating_systems::get_Win32_OperatingSystem; fn main() -> Result<(), Box> { let com_con = COMLibrary::new()?; diff --git a/src/lib.rs b/src/lib.rs index 794674c..93f589c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,17 +14,16 @@ //! Usage: //! //! ```ignore +//! use query_wmi::{COMLibrary, Variant, WMIConnection}; //! use query_wmi::computer_hardware::{ -//! get_Win32_CDROMDrive, get_Win32_ComputerSystem, get_Win32_OperatingSystem, +//! get_Win32_CDROMDrive, get_Win32_ComputerSystem, //! get_Win32_PCMCIAController, get_Win32_PnPEntity, get_Win32_Processor, //! get_Win32_SystemEnclosure, get_Win32_TapeDrive, get_Win32_USBHub, //! }; -//! -//! use wmi::COMLibrary; +//! use query_wmi::operating_systems::get_Win32_OperatingSystem; //! //! fn main() -> Result<(), Box> { //! let com_con = COMLibrary::new()?; -//! //! dbg!(get_Win32_OperatingSystem(com_con)?); //! dbg!(get_Win32_CDROMDrive(com_con)?); //! dbg!(get_Win32_ComputerSystem(com_con)?); @@ -34,7 +33,6 @@ //! dbg!(get_Win32_SystemEnclosure(com_con)?); //! dbg!(get_Win32_USBHub(com_con)?); //! dbg!(get_Win32_TapeDrive(com_con)?); -//! //! Ok(()) //! } //! ``` diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 594a8f6..0000000 --- a/src/main.rs +++ /dev/null @@ -1,11 +0,0 @@ -use query_wmi::services::{get_Win32_DependentService, get_Win32_Service}; -use query_wmi::COMLibrary; - -fn main() -> Result<(), Box> { - let com_con = COMLibrary::new()?; - - dbg!(get_Win32_Service(com_con)?); - dbg!(get_Win32_DependentService(com_con)?); - - Ok(()) -}