Skip to main content

DroppedFile

Trait DroppedFile 

Source
pub trait DroppedFile: Debug {
    // Required methods
    fn path(&self) -> &Path;
    fn bytes(&self) -> Result<Vec<u8>, String>;
}
Expand description

A file dropped into egui.

The integration owns the concrete file handle, letting egui remain independent of windowing backends and file APIs.

Required Methods§

Source

fn path(&self) -> &Path

The path of the dropped file.

This is an absolute path on native platforms. On the web, it is a relative path containing only the file name because browsers do not expose the file’s local path.

Source

fn bytes(&self) -> Result<Vec<u8>, String>

Read the file contents.

§Errors

Returns an error if the file cannot be read.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§