[−][src]Crate winrt
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 infos = ProcessDiagnosticInfo::get_for_processes().unwrap().unwrap(); println!("Currently executed processes ({}):", infos.get_size().unwrap()); for p in &infos { let p = p.unwrap(); let pid = p.get_process_id().unwrap(); let exe = 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 | Enables classes to be activated using a default constructor.
This interface should not be used directly, but the |
IAgileObject | Interface that marks an object as agile.
It inherits from |
IInspectable | The |
IMemoryBufferByteAccess | Provides direct byte access to the memory buffer underlying an |
IteratorAdaptor |
Enums
ApartmentType | Determines the concurrency model used for incoming calls to the objects created by a thread
that was initialized with a given apartment type (see also |
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 | Extension for |
RtAsyncOperation | Extension for |
RtClassInterface | Marker trait for all interfaces that are not factories or statics. |
RtDefaultConstructible | Enables easy access to a default constructor, using |
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. |
Functions
init_apartment | Initializes the current thread for use with the Windows Runtime. This is usually not needed,
because winrt-rust ensures that threads are implicitly assigned to the multi-threaded apartment (MTA).
However, if you need your thread to be initialized as a single-threaded apartment (STA), you can
call |
uninit_apartment | Uninitializes the Windows Runtime in the current thread. This is usually not needed, because uninitialization happens automatically on process termination. Make sure that you never call this from a thread that still has references to Windows Runtime objects. |
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) |