Expand description
A description of a filetype, for specifying allowed types in a file dialog.
Windows
Each instance of this type is converted to a COMDLG_FILTERSPEC
struct.
macOS
These file types also apply to directories to define them as packages.
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 ‘.’.
Implementations§
source§impl FileSpec
impl FileSpec
pub const TEXT: FileSpec = FileSpec::new("Text", &["txt"])
pub const JPG: FileSpec = FileSpec::new("Jpeg", &["jpg", "jpeg"])
pub const GIF: FileSpec = FileSpec::new("Gif", &["gif"])
pub const PNG: FileSpec = FileSpec::new("Portable network graphics (png)", &["png"])
pub const PDF: FileSpec = FileSpec::new("PDF", &["pdf"])
pub const HTML: FileSpec = FileSpec::new("Web Page", &["htm", "html"])
Trait Implementations§
source§impl PartialEq<FileSpec> for FileSpec
impl PartialEq<FileSpec> for FileSpec
impl Copy for FileSpec
impl Eq for FileSpec
impl StructuralEq for FileSpec
impl StructuralPartialEq for FileSpec
Auto Trait Implementations§
impl RefUnwindSafe for FileSpec
impl Send for FileSpec
impl Sync for FileSpec
impl Unpin for FileSpec
impl UnwindSafe for FileSpec
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.