Skip to main content

Wmi

Struct Wmi 

Source
pub struct Wmi { /* private fields */ }
Expand description

A live COM WMI session bound to a single namespace on the local host.

Threading: connect_local forces the MTA. The instance is deliberately !Send — the underlying COM proxies are apartment-scoped and must be touched from the thread that initialized COM.

Drop order matters here: Rust drops fields in declaration order, so the COM interfaces (services, _locator) release first, and only then does [ComGuard] run CoUninitialize. Calling Release on a live proxy after CoUninitialize is undefined behavior — an easy way to earn an 0xc0000005 in a test binary.

Implementations§

Source§

impl Wmi

Source

pub fn connect_local(_namespace: &str) -> Result<Self>

Source

pub fn query_raw( &self, _wql: &str, ) -> Result<Box<dyn Iterator<Item = Result<Row>>>>

Source

pub fn query<T>( &self, _wql: &str, ) -> Result<Box<dyn Iterator<Item = Result<T>>>>
where T: FromWbem + 'static,

Auto Trait Implementations§

§

impl !Send for Wmi

§

impl !Sync for Wmi

§

impl Freeze for Wmi

§

impl RefUnwindSafe for Wmi

§

impl Unpin for Wmi

§

impl UnsafeUnpin for Wmi

§

impl UnwindSafe for Wmi

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.