pub struct BackgroundPickerApp {
pub args: Args,
pub images: Vec<ImageInfo>,
pub folder_tree: BTreeMap<String, Vec<usize>>,
pub loading: bool,
pub thumbnail_sender: Sender<(usize, ColorImage)>,
pub thumbnail_receiver: Receiver<(usize, ColorImage)>,
pub thread_pool: ThreadPool,
pub cache_dir: PathBuf,
}Fields§
§args: Args§images: Vec<ImageInfo>§folder_tree: BTreeMap<String, Vec<usize>>§loading: bool§thumbnail_sender: Sender<(usize, ColorImage)>§thumbnail_receiver: Receiver<(usize, ColorImage)>§thread_pool: ThreadPool§cache_dir: PathBufImplementations§
Source§impl BackgroundPickerApp
impl BackgroundPickerApp
Sourcepub fn new(_cc: &CreationContext<'_>, args: Args) -> Result<Self>
pub fn new(_cc: &CreationContext<'_>, args: Args) -> Result<Self>
§Errors
Returns an error if the background thread pool or the thumbnail cache directory cannot be created.
pub fn scan_images(&mut self)
pub fn pregenerate_all_thumbnails(&mut self)
Sourcepub fn load_thumbnail(&mut self, ctx: &Context, index: usize)
pub fn load_thumbnail(&mut self, ctx: &Context, index: usize)
Kicks off background loading of a single thumbnail, if it isn’t already
loaded or in flight. ctx is cloned into the worker so it can wake the
UI thread the moment the result is ready.
Sourcepub fn preload_batch(&mut self, ctx: &Context, indices: &[usize])
pub fn preload_batch(&mut self, ctx: &Context, indices: &[usize])
Kicks off background loading for the first few not-yet-loaded images in
indices, typically called when a folder is expanded in the UI.
pub fn process_thumbnail_results(&mut self, ctx: &Context)
Trait Implementations§
Source§impl App for BackgroundPickerApp
impl App for BackgroundPickerApp
Source§fn ui(&mut self, ui: &mut Ui, _frame: &mut Frame)
fn ui(&mut self, ui: &mut Ui, _frame: &mut Frame)
Called each time the UI needs repainting, which may be many times per second. Read more
Source§fn logic(&mut self, ctx: &Context, frame: &mut Frame)
fn logic(&mut self, ctx: &Context, frame: &mut Frame)
Called once before each call to
Self::ui,
and additionally also called when the UI is hidden, but egui::Context::request_repaint was called. Read moreSource§fn save(&mut self, _storage: &mut dyn Storage)
fn save(&mut self, _storage: &mut dyn Storage)
Called on shutdown, and perhaps at regular intervals. Allows you to save state. Read more
Source§fn on_exit(&mut self, _gl: Option<&Context>)
fn on_exit(&mut self, _gl: Option<&Context>)
Called once on shutdown, after
Self::save. Read moreSource§fn auto_save_interval(&self) -> Duration
fn auto_save_interval(&self) -> Duration
Time between automatic calls to
Self::saveSource§fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
fn clear_color(&self, _visuals: &Visuals) -> [f32; 4]
Background color values for the app, e.g. what is sent to
gl.clearColor. Read moreSource§fn persist_egui_memory(&self) -> bool
fn persist_egui_memory(&self) -> bool
Controls whether or not the egui memory (window positions etc) will be
persisted (only if the “persistence” feature is enabled).
Auto Trait Implementations§
impl !RefUnwindSafe for BackgroundPickerApp
impl !Sync for BackgroundPickerApp
impl !UnwindSafe for BackgroundPickerApp
impl Freeze for BackgroundPickerApp
impl Send for BackgroundPickerApp
impl Unpin for BackgroundPickerApp
impl UnsafeUnpin for BackgroundPickerApp
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn 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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
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.Source§fn as_any(&self) -> &(dyn Any + 'static)
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.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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 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> ⓘ
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