Crate winrt [−] [src]
Using Windows Runtime APIs from Rust.
Example
extern crate winrt; use winrt::*; // import various helper types use winrt::windows::system::diagnostics::*; // import namespace Windows.System.Diagnostics fn main() { let rt = RuntimeContext::init(); // initialize the Windows Runtime let infos = ProcessDiagnosticInfo::get_for_processes().unwrap(); println!("Currently executed processes ({}):", unsafe { infos.get_size().unwrap() }); for p in infos.into_iter() { let pid = unsafe { p.get_process_id().unwrap() }; let exe = unsafe { p.get_executable_file_name().unwrap() }; println!("[{}] {}", pid, exe); } }
Modules
windows |
Structs
BStr |
A wrapper around |
Char |
Represents a single UTF-16 character. This is the standard character type in WinRT. |
ComArray |
Owned array type that is used as return type when WinRT methods return arrays.
It wraps a block of memory that has been allocated by WinRT and will be deallocated
using |
ComPtr |
Smart pointer for Windows Runtime objects. This pointer automatically maintains the reference count of the underlying COM object. |
FastHString |
A string type that should be used to create strings that can be passed to Windows Runtime
functions. Creating a new |
Guid |
Represents a GUID type in the Windows Runtime type system. |
HString |
A wrapper over an |
HStringArg |
References of this type are passed to WinRT functions. You can not create a value of
this type, only references can exist and are obtained via (automatic) dereferencing of
|
HStringReference |
A reference to either an |
IActivationFactory | |
IAgileObject |
Interface that marks an object as agile.
It inherits from |
IInspectable |
The |
RuntimeContext |
Manages initialization and uninitialization of the Windows Runtime. |
Enums
Error |
Represents an error as a result of a Windows Runtime method call. |
Traits
ComIid |
Provides a way to get the IID for a COM/WinRT interface. This should be implemented for all interfaces, except parameterized ones, because IIDs of parameterized interfaces depend on concrete instantiations of the parameter types. |
ComInterface |
Marker trait for all COM-compatible interfaces. |
RtActivatable | |
RtAsyncAction | |
RtAsyncOperation | |
RtClassInterface |
Marker trait for all interfaces that are not factories or statics. |
RtInterface |
Marker trait for all Windows Runtime interfaces. They must inherit from |
RtNamedClass |
This trait is implemented by all classes that have a name associated with them which can be used at runtime. |
RtType |
This is a trait implemented by all types that can be used as generic parameters of parameterized interfaces.
|
RtValueType |
Marker trait for all value types (primitive types, structs, enums) that can be used as generic parameters in Windows Runtime. |
Type Definitions
HRESULT |
Re-export from WinAPI crate |
IRestrictedErrorInfo |
Re-export from WinAPI crate |
IUnknown |
Re-export from WinAPI crate |
Result |
A specialized |
TrustLevel |
Represents the trust level of an activatable class (re-export from WinAPI crate) |