FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DataTransferExtensions

    trait · ferroui-base · v0.5.0

    trait DataTransferExtensions: IDataTransfer
    

    Contains extension methods for IDataTransfer.

    View source

    Members

    contains

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

    Gets whether the data transfer supports a specific format.

    Source

    get_items

    fn get_items(self: &Self, format: &DataFormat) -> DataTransferItems
    

    Gets the list of IDataTransferItem contained in the data transfer, filtered by a given format.

    Some platforms (such as Windows and X11) may only support a single data item for all formats except files.

    Source

    try_get_value

    fn try_get_value<T: Clone + 'static>(self: &Self, format: &DataFormatOf<T>) -> Option<T>
    

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

    If the data transfer contains several items supporting the format, the first matching one will be returned.

    Source

    try_get_values

    fn try_get_values<T: Clone + 'static>(self: &Self, format: &DataFormatOf<T>) -> Option<Vec<T>>
    

    Tries to get multiple values for a given format from the data transfer. Returns None if the format is not supported.

    Source

    try_get_text

    fn try_get_text(self: &Self) -> Option<String>
    

    Returns a text, if available, from the data transfer.

    If the data transfer contains several items supporting DataFormat::text, the first matching one will be returned.

    Source

    try_get_bitmap

    fn try_get_bitmap(self: &Self) -> Option<Rc<Bitmap>>
    

    Returns a bitmap, if available, from the data transfer.

    If the data transfer contains several items supporting DataFormat::bitmap, the first matching one will be returned.

    Source

    try_get_file

    fn try_get_file(self: &Self) -> Option<Rc<dyn IStorageItem>>
    

    Returns a file (or folder), if available, from the data transfer.

    See DataFormat::file.

    Source

    try_get_files

    fn try_get_files(self: &Self) -> Option<Vec<Rc<dyn IStorageItem>>>
    

    Returns the files (or folders), if available, from the data transfer.

    See DataFormat::file.

    Source

    Trait implementations

    Availability

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