pub struct FileFilter {
pub name: String,
pub extensions: Vec<String>,
}Expand description
File filter (e.g., “Images” -> [“png”, “jpg”]).
Extensions are matched case-insensitively and should be provided without a
leading dot. Multi-layer extensions are supported by including dots in the
extension string (e.g. "vcxproj.filters").
Advanced patterns (ImGui backend only):
- Wildcards: tokens containing
*or?are treated like IGFD’s asterisk filters and matched against the full extension string (e.g.".vcx.*",".*.filters","*.*"). - Regex: tokens wrapped in
((…))are treated as regular expressions and matched against the full base name (case-insensitive).
The variants created from tuples will be normalized to lowercase automatically.
Fields§
§name: StringFilter display name
extensions: Vec<String>Lower-case extensions without dot (e.g., “png”, “vcxproj.filters”)
Implementations§
Source§impl FileFilter
impl FileFilter
Sourcepub fn new(name: impl Into<String>, exts: impl Into<Vec<String>>) -> Self
pub fn new(name: impl Into<String>, exts: impl Into<Vec<String>>) -> Self
Create a filter from a name and extensions.
Extensions should be provided without leading dots (e.g. "png",
"vcxproj.filters"). Matching is case-insensitive.
Sourcepub fn parse_igfd(spec: &str) -> Result<Vec<FileFilter>, IgfdFilterParseError>
pub fn parse_igfd(spec: &str) -> Result<Vec<FileFilter>, IgfdFilterParseError>
Parse an ImGuiFileDialog (IGFD) style filter spec into one or more FileFilters.
Supported forms:
- Simple list:
".cpp,.h,.hpp" - Collections:
"C/C++{.c,.cpp,.h},Rust{.rs}"
Notes:
- Commas inside parentheses
(...)do not split (IGFD rule 2). - Regex tokens
((...))are preserved verbatim. - Whitespace around commas/tokens is ignored.
Trait Implementations§
Source§impl Clone for FileFilter
impl Clone for FileFilter
Source§fn clone(&self) -> FileFilter
fn clone(&self) -> FileFilter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileFilter
impl Debug for FileFilter
Source§impl Default for FileFilter
impl Default for FileFilter
Source§fn default() -> FileFilter
fn default() -> FileFilter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FileFilter
impl RefUnwindSafe for FileFilter
impl Send for FileFilter
impl Sync for FileFilter
impl Unpin for FileFilter
impl UnsafeUnpin for FileFilter
impl UnwindSafe for FileFilter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more