FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    PlatformDataTransferItem

    struct · ferroui-base · v0.5.0

    struct PlatformDataTransferItem
    

    The base of the synchronous data transfer items of the platform backends: caches the formats and only asks for the values of supported formats.

    View source

    Members

    new

    fn new(platform_impl: impl PlatformDataTransferItemImpl + 'static) -> Rc<PlatformDataTransferItem>
    

    Creates the item for a backend implementation.

    Source

    create

    fn create<T: 'static>(format: &DataFormatOf<T>, value: T) -> Rc<PlatformDataTransferItem>
    

    Creates an item with a single format and its value.

    Source

    formats

    fn formats(self: &Self) -> Rc<[DataFormat]>
    

    Gets the formats supported by this item.

    Panics

    Panics if the backend fails to provide them (where the reference throws from the property); try_formats reports the failure instead.

    Source

    try_formats

    fn try_formats(self: &Self) -> Result<Rc<[DataFormat]>, ClipboardError>
    

    Gets the formats supported by this item, or the failure of the backend providing them.

    Source

    contains

    fn contains(self: &Self, format: &DataFormat) -> bool
    

    Gets whether the item supports a specific format.

    Source

    try_get_raw

    fn try_get_raw(self: &Self, format: &DataFormat) -> Option<Rc<dyn Any>>
    

    Tries to get a value for a given format. Returns None if the format is not supported.

    Panics

    Panics if the backend fails to provide the formats or the value (where the reference throws); try_get_raw_result reports the failure instead.

    Source

    try_get_raw_result

    fn try_get_raw_result(self: &Self, format: &DataFormat) -> Result<Option<Rc<dyn Any>>, ClipboardError>
    

    Tries to get a value for a given format: None if the format is not supported, or the failure of the backend providing the formats or the value.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.