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: DirectoryContentStateCurrent 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
impl DirectoryContent
Sourcepub fn from_path(
config: &FileDialogConfig,
path: &Path,
file_system: Arc<dyn FileSystem + Sync + Send + 'static>,
filter: DirectoryFilter,
) -> Self
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.
fn with_thread( config: &FileDialogConfig, path: &Path, file_system: Arc<dyn FileSystem + Send + Sync + 'static>, filter: DirectoryFilter, ) -> Self
fn without_thread( config: &FileDialogConfig, path: &Path, file_system: &dyn FileSystem, filter: &DirectoryFilter, ) -> Self
pub fn update(&mut self) -> &DirectoryContentState
fn update_pending_state(&mut self) -> &DirectoryContentState
Sourcepub fn iter_range_mut(
&mut self,
range: Range<usize>,
) -> impl Iterator<Item = &mut DirectoryEntry>
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.
pub fn filtered_iter<'s>( &'s self, search_value: &'s str, ) -> impl Iterator<Item = &'s DirectoryEntry> + 's
pub fn filtered_iter_mut<'s>( &'s mut self, search_value: &'s str, ) -> impl Iterator<Item = &'s mut DirectoryEntry> + 's
Sourcepub fn reset_multi_selection(&mut self)
pub fn reset_multi_selection(&mut self)
Marks each element in the content as unselected.
Sourcepub fn push(&mut self, item: DirectoryEntry)
pub fn push(&mut self, item: DirectoryEntry)
Pushes a new item to the content.
Trait Implementations§
Source§impl Debug for DirectoryContent
impl Debug for DirectoryContent
Auto Trait Implementations§
impl Freeze for DirectoryContent
impl !RefUnwindSafe for DirectoryContent
impl Send for DirectoryContent
impl Sync for DirectoryContent
impl Unpin for DirectoryContent
impl !UnwindSafe for DirectoryContent
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