Skip to main content

Files

Struct Files 

Source
pub struct Files(/* private fields */);
Expand description

The choices open, as a service.

Implementations§

Source§

impl Files

Source

pub fn file_system(&self) -> SharedFs

Where the in-app picker reads.

Source

pub fn set_file_system(&self, fs: SharedFs)

Reads from fs in the in-app pickers opened from now on.

Source

pub fn previews(&self) -> Previews

The preview providers, their cache and their worker: a plugin registers its providers here (Previews::register).

Source

pub fn groupings(&self) -> Groupings

The groupings of files: a plugin declares its own here (Groupings::register).

Source

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).

Source

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.

Source

pub fn choose(&self, app: &AppHandle, request: FileRequest) -> Pending

Starts a choice; its result comes later through the Pending.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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).

Source

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.

Source

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.

Source

pub fn open_ids(&self) -> Vec<u64>

The choices open, by id.

Source

pub fn describe(&self) -> Json

The choices open and the last ones, as the bridge shows them.

Source

pub fn picker(&self, id: u64) -> Option<FilePicker>

The in-app picker of an open choice (tests and agents drive it).

Trait Implementations§

Source§

impl Clone for Files

Source§

fn clone(&self) -> Files

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Files

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Files

Source§

fn default() -> Files

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> SerializableAny for T
where T: 'static + Any + Clone + for<'a> Send + Sync,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,