[][src]Struct druid_shell::FileSpec

pub struct FileSpec {
    pub name: &'static str,
    pub extensions: &'static [&'static str],
}

A description of a filetype, for specifiying allowed types in a file dialog.

Windows

On windows, each instance of this type is converted to a COMDLG_FILTERSPEC struct.

Fields

name: &'static str

A human readable name, describing this filetype.

This is used in the Windows file dialog, where the user can select from a dropdown the type of file they would like to choose.

This should not include the file extensions; they will be added automatically. For instance, if we are describing Word documents, the name would be "Word Document", and the displayed string would be "Word Document (*.doc)".

extensions: &'static [&'static str]

The file extensions used by this file type.

This should not include the leading '.'.

Methods

impl FileSpec[src]

pub const TEXT: FileSpec[src]

pub const JPG: FileSpec[src]

pub const GIF: FileSpec[src]

pub const PDF: FileSpec[src]

pub const HTML: FileSpec[src]

pub const fn new(
    name: &'static str,
    extensions: &'static [&'static str]
) -> Self
[src]

Create a new FileSpec.

Trait Implementations

impl Clone for FileSpec[src]

impl Copy for FileSpec[src]

impl Debug for FileSpec[src]

impl PartialEq<FileSpec> for FileSpec[src]

impl StructuralPartialEq for FileSpec[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> RoundFrom<T> for T

impl<T, U> RoundInto<U> for T where
    U: RoundFrom<T>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.