Skip to main content

PropertySystem

Trait PropertySystem 

Source
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

IPropertySystem (propsys.h)

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§

Source

fn new_init() -> Result<IPropertySystem>

Call CoInitialize() before PropertySystem::new().

Source

fn new() -> Result<IPropertySystem>

Source

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 format
  • propvar: The property value to format
  • pdff: Format flags
  • buffer: Mutable buffer to receive the formatted string (UTF-16)
Source

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 format

    Can 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".

Implementors§