#[non_exhaustive]pub struct PathHint {
pub kind: PathKind,
pub extensions: Vec<String>,
pub title: Option<String>,
pub purpose: Option<String>,
pub filter_name: Option<String>,
}Expand description
A text that names a path on disk: what it names and, for a file, the
extensions accepted (none: any). A form shows it with a Browse button,
whose chooser title, purpose and
filter_name the hint may give. Built with
PathHint::new or Descriptor::path: a field added later breaks
nobody.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.kind: PathKind§extensions: Vec<String>Without the dot, lowercase (json, txt).
title: Option<String>The chooser’s title, a task (“Choose the export folder”); none: the field’s label.
purpose: Option<String>The key the chooser’s last folder is remembered under; none: the form’s command and the field’s key.
filter_name: Option<String>What the chooser calls the extensions’ filter (“Enrolment files”); none: the extensions joined.
Implementations§
Source§impl PathHint
impl PathHint
Sourcepub fn new(kind: PathKind, extensions: &[&str]) -> Self
pub fn new(kind: PathKind, extensions: &[&str]) -> Self
A path of kind; for a file, the extensions accepted (none: any).
Sourcepub fn title(self, title: &str) -> Self
pub fn title(self, title: &str) -> Self
The chooser’s title, a task rather than the field’s label.
Sourcepub fn filter_name(self, name: &str) -> Self
pub fn filter_name(self, name: &str) -> Self
What the chooser calls the extensions’ filter.