Struct LibraryState

Source
pub struct LibraryState {
Show 24 fields pub tab: usize, pub selected: Option<u64>, pub sel_path: Option<String>, pub sel_ids: Vec<u64>, pub sel_paths: Vec<String>, pub seen_selected: Option<u64>, pub search: String, pub kind_filter: u8, pub label_filter: u8, pub unused_only: bool, pub sort: u8, pub view: u8, pub zoom: f32, pub folder: Option<String>, pub flipped: Vec<String>, pub rename_folder: Option<(String, String)>, pub new_folder: Option<(String, String)>, pub tags_for: Option<u64>, pub tags_buf: String, pub rename_seq: Option<(u64, String)>, pub rename_template: Option<(usize, String)>, pub recent_tags_for: Option<String>, pub recent_tags_buf: String, pub dirs: Vec<(String, Option<Vec<(String, bool)>>)>,
}

Fields§

§tab: usize

0 = Imported (what the project contains), 1 = Global (recent files + the linked folders).

§selected: Option<u64>

Anchor of the selection: the asset a click landed on, and the one the preview box shows. app.rs writes it straight after an import — show spots that and collapses the set onto it.

§sel_path: Option<String>

Same, for a selected file that is not a project asset.

§sel_ids: Vec<u64>

The whole selection (Ctrl / Shift click, rubber band); the anchor above is one of these.

§sel_paths: Vec<String>§seen_selected: Option<u64>

selected as of the end of the last frame — the only way to tell app.rs’s write from ours.

§search: String§kind_filter: u8

0 All, 1 Video, 2 Audio, 3 Image, 4 Sequences, 5 Short SFX, 6 Music

§label_filter: u8

0 = any, 1..=8 = LABEL_COLORS index + 1

§unused_only: bool§sort: u8

0 name, 1 duration, 2 kind, 3 recently added

§view: u8

0 = list rows, 1 = thumbnail gallery. Applies to both tabs.

§zoom: f32

Thumbnail scale, ZOOM_MIN..=ZOOM_MAX. 0 = never set, read as 1.

§folder: Option<String>

The folder clicked in the tree — highlighted, and the subtree a search is limited to. None = all folders, Some(“”) = root only, Some(name) = that folder (+ subfolders)

§flipped: Vec<String>

Tree nodes whose open state differs from the default (project folders start open, Recent and folders on disk start closed). Keys: “recent”, “f:”, dir_key(path).

§rename_folder: Option<(String, String)>

(folder being renamed, edit buffer = new last segment)

§new_folder: Option<(String, String)>

(parent, edit buffer) — “” parent = top level

§tags_for: Option<u64>

Tag edit buffer for the previewed asset (avoids the comma being eaten while typing).

§tags_buf: String§rename_seq: Option<(u64, String)>§rename_template: Option<(usize, String)>§recent_tags_for: Option<String>

Same, for the previewed file on disk (its tags live on its RecentAsset).

§recent_tags_buf: String§dirs: Vec<(String, Option<Vec<(String, bool)>>)>

One-level directory listings, keyed by folder path: (entry path, is a folder), folders first, None = unreadable. Only ever filled for a node the user expanded; dropped on Refresh / unlink.

Implementations§

Source§

impl LibraryState

Source

fn has(&self, p: &Pick) -> bool

Source

fn anchor(&self) -> Option<Pick>

The item the preview box shows and Shift-click ranges from.

Source

fn set_anchor(&mut self, p: &Pick)

Source

fn add_sel(&mut self, p: &Pick)

Source

fn drop_sel(&mut self, p: &Pick)

Source

fn clear_sel(&mut self)

Trait Implementations§

Source§

impl Default for LibraryState

Source§

fn default() -> LibraryState

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.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

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, U> ToSample<U> for T
where U: FromSample<T>,

§

fn to_sample_(self) -> U

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> 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<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

§

impl<T> MaybeSend for T

§

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