pub trait PropertySystem {
// Required methods
fn new_init() -> Result<IPropertySystem>;
fn new() -> Result<IPropertySystem>;
fn format_for_display<'b>(
&self,
key: &PROPERTYKEY,
propvar: &PROPVARIANT,
pdff: PROPDESC_FORMAT_FLAGS,
buffer: &'b mut [u16],
) -> Result<&'b mut U16CStr>;
fn format_for_display_alloc(
&self,
key: &PROPERTYKEY,
propvar: &PROPVARIANT,
pdff: PROPDESC_FORMAT_FLAGS,
) -> Result<PWSTR>;
}Expand description
Exposes methods that get property descriptions, register and unregister property schemas, enumerate property descriptions, and format property values in a type-strict way.
Required Methods§
Sourcefn new_init() -> Result<IPropertySystem>
fn new_init() -> Result<IPropertySystem>
Call CoInitialize() before PropertySystem::new().
Sourcefn format_for_display<'b>(
&self,
key: &PROPERTYKEY,
propvar: &PROPVARIANT,
pdff: PROPDESC_FORMAT_FLAGS,
buffer: &'b mut [u16],
) -> Result<&'b mut U16CStr>
fn format_for_display<'b>( &self, key: &PROPERTYKEY, propvar: &PROPVARIANT, pdff: PROPDESC_FORMAT_FLAGS, buffer: &'b mut [u16], ) -> Result<&'b mut U16CStr>
IPropertySystem::FormatForDisplay (propsys.h)
Formats a property value for display into a user-provided buffer.
§Arguments
key: The property key to formatpropvar: The property value to formatpdff: Format flagsbuffer: Mutable buffer to receive the formatted string (UTF-16)
Sourcefn format_for_display_alloc(
&self,
key: &PROPERTYKEY,
propvar: &PROPVARIANT,
pdff: PROPDESC_FORMAT_FLAGS,
) -> Result<PWSTR>
fn format_for_display_alloc( &self, key: &PROPERTYKEY, propvar: &PROPVARIANT, pdff: PROPDESC_FORMAT_FLAGS, ) -> Result<PWSTR>
IPropertySystem::FormatForDisplayAlloc (propsys.h)
§Arguments
-
key: The property key to formatCan be controlled by
displayInfo. -
propvar: The property value to format -
pdff: Format flags
§Returns
The calling application must use [CoTaskMemFree] to release the returned string when it is no longer needed.
§Implementation
CFormatForDisplay::FormatForDisplay() {
CFormatForDisplay::_FormatSize() {
PSStrFormatKBSizeW()
}
}Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".