pub struct RowSelection {Show 16 fields
pub person: Option<String>,
pub category: Option<String>,
pub place: Option<PlaceQuery>,
pub after: Option<String>,
pub before: Option<String>,
pub has: Vec<PresenceField>,
pub missing: Vec<PresenceField>,
pub kinds: Vec<MediaKind>,
pub exts: Vec<String>,
pub mimes: Vec<String>,
pub paths: Vec<PathBuf>,
pub min_rating: Option<i64>,
pub pick: Option<Pick>,
pub label: Option<String>,
pub liked: bool,
pub tags: Vec<String>,
}Expand description
What a command was asked to work on, over rows already in the database.
Fields§
§person: Option<String>§category: Option<String>§place: Option<PlaceQuery>§after: Option<String>§before: Option<String>§has: Vec<PresenceField>§missing: Vec<PresenceField>§kinds: Vec<MediaKind>§exts: Vec<String>§mimes: Vec<String>§paths: Vec<PathBuf>§min_rating: Option<i64>Minimum star rating (>=), when filtering by rating.
pick: Option<Pick>Exact pick state.
label: Option<String>Exact colour label.
liked: boolOnly liked photos.
Tags that must all be present (AND across multiple –tag values).
Implementations§
Source§impl RowSelection
impl RowSelection
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True when no predicate was given at all.
Derived from the fields directly rather than kept as a separate hand-maintained list, because the failure mode of forgetting to update such a list is silent: the command processes the entire library.
Sourcepub fn resolve(&self, conn: &Connection, ctx: &SelectionCtx) -> Result<Resolved>
pub fn resolve(&self, conn: &Connection, ctx: &SelectionCtx) -> Result<Resolved>
Run every active predicate and intersect them.
Predicates OR within an axis (--ext mov,avi matches either) and AND
across axes (--type video --ext jpg matches nothing), which is how
every existing filter already composes.
Path filters are resolved against the process’s ambient filesystem
here; a caller holding a library context should use
RowSelection::resolve_in, which constrains them to that library
first.
Sourcepub fn resolve_in(
&self,
conn: &Connection,
ctx: &SelectionCtx,
library: &LibraryContext,
) -> Result<Resolved>
pub fn resolve_in( &self, conn: &Connection, ctx: &SelectionCtx, library: &LibraryContext, ) -> Result<Resolved>
Resolve one selection against one library, with its path filters constrained to that library before anything else runs.
The only difference from RowSelection::resolve is the path axis:
every supplied filter is validated by
library_guard::validate_paths
(relative filters resolve against the library root, absolute ones must
physically land inside it), and one bad filter rejects the whole
invocation rather than being quietly dropped. The guarded forms are
substituted into a clone and run through the same engine as the
ambient resolver, so a direct caller cannot bypass the guard by
skipping CLI parsing, and every other axis behaves identically. A
selection with no path filters resolves exactly as Self::resolve
does.
Trait Implementations§
Source§impl Clone for RowSelection
impl Clone for RowSelection
Source§fn clone(&self) -> RowSelection
fn clone(&self) -> RowSelection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more