pub struct Files(/* private fields */);Expand description
The choices open, as a service.
Implementations§
Source§impl Files
impl Files
Sourcepub fn file_system(&self) -> SharedFs
pub fn file_system(&self) -> SharedFs
Where the in-app picker reads.
Sourcepub fn set_file_system(&self, fs: SharedFs)
pub fn set_file_system(&self, fs: SharedFs)
Reads from fs in the in-app pickers opened from now on.
Sourcepub fn previews(&self) -> Previews
pub fn previews(&self) -> Previews
The preview providers, their cache and their worker: a plugin
registers its providers here (Previews::register).
Sourcepub fn groupings(&self) -> Groupings
pub fn groupings(&self) -> Groupings
The groupings of files: a plugin declares its own here
(Groupings::register).
Sourcepub fn place_providers(&self) -> PlaceProviders
pub fn place_providers(&self) -> PlaceProviders
The application’s sections of places, listed by the in-app picker
under its own and by a places::PlacesPanel: a plugin declares
its own here (PlaceProviders::register).
Sourcepub fn places(&self, app: &AppHandle) -> Places
pub fn places(&self, app: &AppHandle) -> Places
The places as the in-app picker lists them now: home, the system’s
folders and volumes (read when a picker last opened), recent places,
bookmarks and the application’s sections. Places::sections gives
them as one list of sections, for a places::PlacesPanel.
Sourcepub fn choose(&self, app: &AppHandle, request: FileRequest) -> Pending
pub fn choose(&self, app: &AppHandle, request: FileRequest) -> Pending
Starts a choice; its result comes later through the Pending.
Sourcepub fn choose_inline(
&self,
app: &AppHandle,
request: FileRequest,
) -> (u64, Pending)
pub fn choose_inline( &self, app: &AppHandle, request: FileRequest, ) -> (u64, Pending)
Starts a choice whose in-app picker the caller draws itself, in a
dialog of its own (Files::show_inline); the system’s chooser,
or a plugin’s, is used the same way. Gives the choice’s id.
Sourcepub fn show_inline(&self, ui: &mut Ui, app: &AppHandle, id: u64) -> bool
pub fn show_inline(&self, ui: &mut Ui, app: &AppHandle, id: u64) -> bool
Draws the in-app picker of a choice started with
Files::choose_inline, if it has one; says whether it did.
Sourcepub fn owner(&self, id: u64) -> Option<ViewportId>
pub fn owner(&self, id: u64) -> Option<ViewportId>
The window a choice was asked from (Files::choose called in its
pass, or for its command): its in-app picker shows over that
window’s group. None once the choice is over.
Sourcepub fn highlighted(&self, id: u64) -> Option<Entry>
pub fn highlighted(&self, id: u64) -> Option<Entry>
The entry highlighted in the in-app picker of a choice (the one its
preview is of, where the arrows are): what another panel follows
(docs/linked-panels.md). None without a picker or an entry.
Sourcepub fn deliver(
&self,
id: u64,
answer: Option<Vec<PathBuf>>,
) -> Result<(), String>
pub fn deliver( &self, id: u64, answer: Option<Vec<PathBuf>>, ) -> Result<(), String>
Answers a choice (applied on the next frame): paths, or None
for cancelled, as the user. For a run-hook replacing the chooser.
Sourcepub fn deliver_as(
&self,
id: u64,
answer: Option<Vec<PathBuf>>,
origin: Origin,
) -> Result<(), String>
pub fn deliver_as( &self, id: u64, answer: Option<Vec<PathBuf>>, origin: Origin, ) -> Result<(), String>
As Files::deliver, answered by origin (an agent through the
debug bridge): the origin goes with the choice, to the
file.chosen step (origin), the journal and the result
(chosen_origin).
Sourcepub fn set_choices(&self, id: u64, values: &ChoiceValues) -> Result<(), String>
pub fn set_choices(&self, id: u64, values: &ChoiceValues) -> Result<(), String>
Sets the application’s choices of an open choice (FileRequest::choice)
as its answer goes: for a run-hook replacing the chooser, with
Files::deliver. The values are checked against the request; those
not given keep the in-app picker’s, else their defaults.
Sourcepub fn set_system_places(
&self,
source: Arc<dyn Fn() -> SystemPlaces + Send + Sync>,
)
pub fn set_system_places( &self, source: Arc<dyn Fn() -> SystemPlaces + Send + Sync>, )
Gives the system’s places the in-app picker lists (its folders and the
volumes mounted) from source rather than from the system
(places::system_places): a demo’s, a sandbox’s, a test’s. It is
asked when a picker opens.
Sourcepub fn picker(&self, id: u64) -> Option<FilePicker>
pub fn picker(&self, id: u64) -> Option<FilePicker>
The in-app picker of an open choice (tests and agents drive it).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Files
impl RefUnwindSafe for Files
impl Send for Files
impl Sync for Files
impl Unpin for Files
impl UnsafeUnpin for Files
impl UnwindSafe for Files
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more