DirectoryContent

Struct DirectoryContent 

Source
pub struct DirectoryContent {
    state: DirectoryContentState,
    content: Vec<DirectoryEntry>,
    content_recv: Option<Arc<Mutex<Receiver<Result<Vec<DirectoryEntry>, Error>>>>>,
}
Expand description

Contains the content of a directory.

Fields§

§state: DirectoryContentState

Current state of the directory content.

§content: Vec<DirectoryEntry>

The loaded directory contents.

§content_recv: Option<Arc<Mutex<Receiver<Result<Vec<DirectoryEntry>, Error>>>>>

Receiver when the content is loaded on a different thread.

Implementations§

Source§

impl DirectoryContent

Source

pub fn from_path( config: &FileDialogConfig, path: &Path, file_system: Arc<dyn FileSystem + Sync + Send + 'static>, filter: DirectoryFilter, ) -> Self

Create a new DirectoryContent object and loads the contents of the given path. Use include_files to include or exclude files in the content list.

Source

fn with_thread( config: &FileDialogConfig, path: &Path, file_system: Arc<dyn FileSystem + Send + Sync + 'static>, filter: DirectoryFilter, ) -> Self

Source

fn without_thread( config: &FileDialogConfig, path: &Path, file_system: &dyn FileSystem, filter: &DirectoryFilter, ) -> Self

Source

pub fn update(&mut self) -> &DirectoryContentState

Source

fn update_pending_state(&mut self) -> &DirectoryContentState

Source

pub fn iter_range_mut( &mut self, range: Range<usize>, ) -> impl Iterator<Item = &mut DirectoryEntry>

Returns an iterator in the given range of the directory contents. No filters are applied using this iterator.

Source

pub fn filtered_iter<'s>( &'s self, search_value: &'s str, ) -> impl Iterator<Item = &'s DirectoryEntry> + 's

Source

pub fn filtered_iter_mut<'s>( &'s mut self, search_value: &'s str, ) -> impl Iterator<Item = &'s mut DirectoryEntry> + 's

Source

pub fn reset_multi_selection(&mut self)

Marks each element in the content as unselected.

Source

pub fn len(&self) -> usize

Returns the number of elements inside the directory.

Source

pub fn push(&mut self, item: DirectoryEntry)

Pushes a new item to the content.

Trait Implementations§

Source§

impl Debug for DirectoryContent

Source§

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

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

impl Default for DirectoryContent

Source§

fn default() -> Self

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

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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