Skip to main content

Module selection

Module selection 

Source
Expand description

Shared vocabulary for saying which files a command should work on.

Two selections exist, deliberately as separate types:

  • RowSelection for commands that query rows (search, embed, faces, classify, locations). It can filter on anything recorded.
  • PathSelection for commands that walk a filesystem (scan, watch). It can only filter on what is knowable before a file is read.

Keeping them separate is the point: adding a predicate to the row side cannot change what scan accepts, because scan does not take that type.

This module holds the primitives both share. The selections themselves and their resolution follow in the same module.

Structs§

PathSelection
What a walking command was asked to work on.
Resolved
The outcome of resolving a selection.
RowSelection
What a command was asked to work on, over rows already in the database.
SelectionCtx
What a command can offer the resolver about itself.

Enums§

MediaKind
The coarse kind of a media file.
PlaceQuery
A place to select around: either a name needing geocoding, or coordinates.

Functions§

normalise_ext
Normalise a user-supplied extension so .MOV, MOV and mov agree.
path_matches_kind
Whether a path matches kind, judged by extension alone.
row_matches_kind
Whether a row’s type matches kind.