pub struct AssetBrowser {
pub root_path: PathBuf,
pub root_dir: DirNodeId,
pub active_dir: DirNodeId,
pub selected: Vec<AssetId>,
pub hovered: Option<AssetId>,
pub filter: AssetFilter,
pub sort_mode: SortMode,
pub sort_ascending: bool,
pub view_mode: ViewMode,
pub thumbnail_size: u32,
pub show_hidden: bool,
pub drag_asset: Option<AssetId>,
/* private fields */
}Expand description
Top-level asset browser state.
Fields§
§root_path: PathBuf§root_dir: DirNodeId§active_dir: DirNodeId§selected: Vec<AssetId>§hovered: Option<AssetId>§filter: AssetFilter§sort_mode: SortMode§sort_ascending: bool§view_mode: ViewMode§thumbnail_size: u32§drag_asset: Option<AssetId>In-progress drag: asset being dragged.
Implementations§
Source§impl AssetBrowser
impl AssetBrowser
pub fn new(root: PathBuf) -> Self
pub fn select_only(&mut self, id: AssetId)
pub fn toggle_select(&mut self, id: AssetId)
pub fn select_all_in_active_dir(&mut self)
pub fn clear_selection(&mut self)
pub fn visible_assets(&self) -> Vec<&AssetEntry>
pub fn search_all(&self, query: &str) -> Vec<&AssetEntry>
pub fn copy_selected(&mut self)
pub fn cut_selected(&mut self)
pub fn paste_count(&self) -> usize
pub fn toggle_favourite(&mut self, id: AssetId)
pub fn toggle_dir_expand(&mut self, dir_id: DirNodeId)
pub fn get(&self, id: AssetId) -> Option<&AssetEntry>
pub fn get_mut(&mut self, id: AssetId) -> Option<&mut AssetEntry>
pub fn total_assets(&self) -> usize
pub fn asset_count_by_kind(&self) -> HashMap<AssetKind, usize>
pub fn status_line(&self) -> String
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AssetBrowser
impl RefUnwindSafe for AssetBrowser
impl Send for AssetBrowser
impl Sync for AssetBrowser
impl Unpin for AssetBrowser
impl UnsafeUnpin for AssetBrowser
impl UnwindSafe for AssetBrowser
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.