2026-04-21 23:00:47 -04:00
|
|
|
[package]
|
|
|
|
|
name = "quicksearch-core"
|
|
|
|
|
version.workspace = true
|
|
|
|
|
edition.workspace = true
|
2026-08-02 19:04:30 -04:00
|
|
|
license.workspace = true
|
|
|
|
|
authors.workspace = true
|
|
|
|
|
repository.workspace = true
|
|
|
|
|
description = "Indexing, storage and search engine behind QuickSearch."
|
2026-04-21 23:00:47 -04:00
|
|
|
|
|
|
|
|
[lib]
|
|
|
|
|
name = "quicksearch_core"
|
|
|
|
|
path = "src/lib.rs"
|
|
|
|
|
|
|
|
|
|
[dependencies]
|
2026-08-02 20:21:19 -04:00
|
|
|
# `bundled-sqlcipher-vendored-openssl` compiles the SQLCipher amalgamation
|
|
|
|
|
# (a superset of the stock SQLite `bundled` build — FTS5 etc. included) and
|
|
|
|
|
# statically links a vendored OpenSSL libcrypto, so encryption support adds
|
|
|
|
|
# no runtime library dependencies. With no `PRAGMA key` applied, SQLCipher
|
|
|
|
|
# behaves identically to stock SQLite, so unencrypted indexes are unaffected.
|
|
|
|
|
rusqlite = { version = "0.39", features = ["bundled-sqlcipher-vendored-openssl"] }
|
|
|
|
|
argon2 = { version = "0.5", features = ["zeroize"] }
|
|
|
|
|
zeroize = { version = "1", features = ["derive"] }
|
|
|
|
|
getrandom = "0.2"
|
2026-04-21 23:00:47 -04:00
|
|
|
sha2 = "0.10.8"
|
|
|
|
|
walkdir = "2.5.0"
|
2026-08-02 22:21:39 -04:00
|
|
|
# Default features pull in zstd 0.11, which cannot unify with our zstd 0.13 below
|
|
|
|
|
# and so builds a second copy of the wrapper crates. We only read OOXML/ODF
|
|
|
|
|
# containers (docx/xlsx/pptx/odt/ods/odp), whose entries are always deflate or
|
|
|
|
|
# stored, so zstd/bzip2/aes-crypto are all dead weight here.
|
|
|
|
|
zip = { version = "0.6", default-features = false, features = ["deflate"] }
|
2026-08-20 02:34:08 -04:00
|
|
|
quick-xml = "0.41"
|
2026-08-05 18:05:04 -04:00
|
|
|
# OLE2 compound-file reader, for the pre-2007 binary Office formats
|
|
|
|
|
# (.doc/.xls/.ppt) whose text lives in named streams rather than a zip. Already
|
|
|
|
|
# in the lockfile transitively via infer, so naming it directly compiles
|
|
|
|
|
# nothing new.
|
|
|
|
|
cfb = "0.7"
|
2026-04-21 23:00:47 -04:00
|
|
|
serde = { version = "1.0", features = ["derive"] }
|
2026-08-17 22:30:43 -04:00
|
|
|
# 1.x, not 0.8: 0.8 pulls `toml_edit`, the whole format-preserving document
|
|
|
|
|
# model, for what is only `from_str` and `to_string_pretty` here. 1.x parses and
|
|
|
|
|
# writes as a stream instead - no `toml_edit`, no `winnow` 0.5 alongside the 1.0
|
|
|
|
|
# already in the tree - which is 252 KB of `.text` this crate was paying for a
|
|
|
|
|
# document API it never touches.
|
|
|
|
|
toml = "1"
|
2026-04-21 23:00:47 -04:00
|
|
|
mime_guess = "2.0"
|
|
|
|
|
infer = "0.15"
|
2026-08-03 12:33:47 -04:00
|
|
|
# Charset decoding for non-UTF-8 text (UTF-16 .reg exports, legacy
|
|
|
|
|
# single-byte and CJK encodings). Already in the lockfile transitively via
|
|
|
|
|
# pdf-extract, so naming it directly compiles nothing new.
|
|
|
|
|
encoding_rs = "0.8"
|
|
|
|
|
# Statistical charset detection (Firefox's detector) for text that is neither
|
|
|
|
|
# UTF-8 nor BOM-marked. Its mandatory deps beyond encoding_rs are tiny
|
|
|
|
|
# (cfg-if, memchr, detone).
|
|
|
|
|
chardetng = "1.0"
|
2026-08-20 18:58:25 -04:00
|
|
|
# RTF text extraction. Pure Rust; depends only on serde.
|
|
|
|
|
#
|
|
|
|
|
# Resolves to `vendor/rtf-parser` through the workspace's `[patch.crates-io]`,
|
|
|
|
|
# which is also where the reasons are written down: the stock lexer ended a
|
|
|
|
|
# control word at whitespace and nowhere else, which silently dropped indexed
|
|
|
|
|
# text from two shapes of document that LibreOffice and Word produce, and the
|
|
|
|
|
# parser panicked on a malformed `\uN` escape. The version here still names
|
|
|
|
|
# 0.4 because that is what the patch is against.
|
|
|
|
|
#
|
|
|
|
|
# `default-features = false` is redundant against the vendored copy, which has
|
|
|
|
|
# no features left to disable — the `jsbindings` one existed for the crate's
|
|
|
|
|
# WebAssembly build and was deleted. It stays so that dropping the patch falls
|
|
|
|
|
# back to a registry build that does not pull wasm-bindgen.
|
2026-08-03 12:33:47 -04:00
|
|
|
rtf-parser = { version = "0.4", default-features = false }
|
2026-08-05 19:17:11 -04:00
|
|
|
# `lopdf` is deliberately NOT declared here. `pdf-extract` re-exports it
|
|
|
|
|
# (`pub use lopdf::*`), and `extract/pdf.rs` reaches it that way. Naming it
|
|
|
|
|
# directly resolves a *second*, older copy alongside pdf-extract's — which is
|
|
|
|
|
# what used to make every PDF parse twice, and what pulled in rayon (whose
|
|
|
|
|
# global thread pool is never torn down), chrono, time, md5 and a second nom.
|
2026-08-02 19:04:30 -04:00
|
|
|
pdf-extract = "0.12"
|
2026-04-21 23:00:47 -04:00
|
|
|
lofty = "0.19"
|
2026-08-17 22:30:43 -04:00
|
|
|
# Parked with `extract::image` — see `extract::ExtractedContent`.
|
|
|
|
|
# kamadak-exif = "0.5"
|
2026-04-21 23:00:47 -04:00
|
|
|
notify = "6.1"
|
|
|
|
|
ctrlc = "3.4"
|
2026-04-23 17:46:11 -04:00
|
|
|
zstd = "0.13"
|
2026-08-02 19:04:30 -04:00
|
|
|
globset = "0.4"
|
|
|
|
|
regex = "1"
|
2026-08-20 18:58:25 -04:00
|
|
|
# Required-literal extraction for the `regex:` prefilter: the same analysis the
|
|
|
|
|
# regex engine does to pick its own prefilter, reused to narrow which rows the
|
|
|
|
|
# regex passes ever see. Already in the lockfile transitively (via `regex`), so
|
|
|
|
|
# naming it directly compiles nothing new.
|
|
|
|
|
regex-syntax = "0.8"
|
2026-08-09 18:36:47 -04:00
|
|
|
# SIMD substring search for the full-text passes. `str::match_indices` uses
|
|
|
|
|
# std's Two-Way searcher, which has no vector prefilter: measured against a
|
|
|
|
|
# 256 KiB body (`benches/search.rs`, group `substring`) it runs 111 µs where
|
|
|
|
|
# `memmem` runs 2.4 µs, and the full-text passes scan a body per candidate
|
|
|
|
|
# row. Already in the lockfile transitively (regex, globset, chardetng), so
|
|
|
|
|
# naming it directly compiles nothing new.
|
|
|
|
|
memchr = "2"
|
2026-08-02 19:04:30 -04:00
|
|
|
|
2026-08-03 03:06:19 -04:00
|
|
|
# `nice()`, for dropping indexing threads to background scheduling priority.
|
|
|
|
|
# Linux schedules per task, so it affects only the calling thread. Already in
|
|
|
|
|
# the lockfile transitively (rusqlite, getrandom), so naming it directly
|
|
|
|
|
# compiles nothing new.
|
|
|
|
|
[target.'cfg(unix)'.dependencies]
|
|
|
|
|
libc = "0.2"
|
|
|
|
|
|
2026-08-02 19:04:30 -04:00
|
|
|
# `GetDriveTypeW` (a mapped drive letter is the only way to spot an SMB share
|
2026-08-05 18:05:04 -04:00
|
|
|
# that isn't written as UNC) plus the FILE_ATTRIBUTE_* constants, which
|
|
|
|
|
# `platform.rs` spells out for itself so its tests run on Linux and then
|
|
|
|
|
# const-asserts against this crate on Windows builds.
|
|
|
|
|
# Pinned to 0.52 deliberately: walkdir → winapi-util already
|
2026-08-02 19:04:30 -04:00
|
|
|
# resolves exactly that version, so this adds no new crate compilations.
|
|
|
|
|
[target.'cfg(windows)'.dependencies]
|
|
|
|
|
# GetDriveTypeW and the FILE_ATTRIBUTE_* constants live in
|
|
|
|
|
# Win32_Storage_FileSystem; DRIVE_REMOTE, oddly, is filed under
|
2026-08-03 03:06:19 -04:00
|
|
|
# Win32_System_WindowsProgramming. Win32_System_Threading carries
|
|
|
|
|
# SetThreadPriority and THREAD_MODE_BACKGROUND_BEGIN, and both it and
|
|
|
|
|
# GetCurrentThread need Win32_Foundation for HANDLE/BOOL.
|
2026-08-02 19:04:30 -04:00
|
|
|
windows-sys = { version = "0.52", features = [
|
2026-08-03 03:06:19 -04:00
|
|
|
"Win32_Foundation",
|
2026-08-05 18:05:04 -04:00
|
|
|
# SECURITY_ATTRIBUTES, which `CreateFileW`'s signature names even though
|
|
|
|
|
# the directory-count path passes null for it.
|
|
|
|
|
"Win32_Security",
|
2026-08-02 19:04:30 -04:00
|
|
|
"Win32_Storage_FileSystem",
|
2026-08-20 02:34:08 -04:00
|
|
|
# OVERLAPPED, which `LockFileEx` takes for the index's instance lock.
|
|
|
|
|
# `LockFileEx` and `GetDiskFreeSpaceExW` themselves are in
|
|
|
|
|
# Win32_Storage_FileSystem above.
|
|
|
|
|
"Win32_System_IO",
|
2026-08-03 03:06:19 -04:00
|
|
|
"Win32_System_Threading",
|
2026-08-02 19:04:30 -04:00
|
|
|
"Win32_System_WindowsProgramming",
|
|
|
|
|
] }
|
2026-08-09 18:36:47 -04:00
|
|
|
|
|
|
|
|
# Microbenchmark harness for `benches/`. Criterion is the more common choice
|
|
|
|
|
# and was rejected: it pulls rayon (a global thread pool that never tears
|
|
|
|
|
# down, the same reason `lopdf` is not named directly above) plus plotters and
|
|
|
|
|
# clap, some forty crates. Divan's mandatory set is a handful and it spawns no
|
|
|
|
|
# threads of its own.
|
|
|
|
|
[dev-dependencies]
|
|
|
|
|
divan = "0.1"
|
|
|
|
|
|
2026-08-20 18:58:25 -04:00
|
|
|
# Writers for `tests/extraction_corpus.rs`. Every one of these is chosen to be
|
|
|
|
|
# a *different implementation* from the reader it feeds: a fixture built with
|
|
|
|
|
# the same library that parses it can only prove the two agree with each other,
|
|
|
|
|
# not that either agrees with the format. The unit tests in `src/extract/` do
|
|
|
|
|
# use the readers' own libraries, deliberately — they aim at malformed input,
|
|
|
|
|
# where the point is to control every byte. This set aims at well-formed input
|
|
|
|
|
# from a foreign producer, which is the other half.
|
|
|
|
|
#
|
|
|
|
|
# None of these reach the release binary: dev-dependencies are linked into test
|
|
|
|
|
# and bench targets only.
|
|
|
|
|
#
|
|
|
|
|
# `.doc`/`.xls`/`.ppt` are absent because nothing in Rust writes OLE2 compound
|
|
|
|
|
# files but `cfb`, which is the reader. Those three are committed fixtures from
|
|
|
|
|
# LibreOffice instead; see `tests/fixtures/legacy/`.
|
|
|
|
|
#
|
|
|
|
|
# docx: writes its own OOXML, and carries `zip` 8.x — a different major from
|
|
|
|
|
# the 0.6 our reader uses, so even the container bytes come from elsewhere.
|
|
|
|
|
# The default `image` feature pulls the whole `image` crate for embedding
|
|
|
|
|
# pictures, which nothing here does.
|
|
|
|
|
docx-rs = { version = "0.4", default-features = false }
|
|
|
|
|
# xlsx: builds a real shared-string table, which is the path `extract_xlsx`
|
|
|
|
|
# actually cares about.
|
|
|
|
|
rust_xlsxwriter = { version = "0.98", default-features = false }
|
|
|
|
|
# pdf: typst's low-level writer. No `lopdf` anywhere in its tree, which is what
|
|
|
|
|
# makes it independent of `pdf-extract`.
|
|
|
|
|
pdf-writer = "0.15"
|
|
|
|
|
# audio tags: `id3` writes the ID3v2 frames `lofty` reads back, `metaflac` the
|
|
|
|
|
# Vorbis comment block. The MPEG frames under the first are hand-rolled; the
|
|
|
|
|
# FLAC stream under the second is committed, because `lofty` reads a real audio
|
|
|
|
|
# frame to derive the stream's properties and a FLAC frame is CRC-checked
|
|
|
|
|
# bit-packed data rather than a fixed header. See `tests/corpus/audio.rs`.
|
|
|
|
|
id3 = "1"
|
|
|
|
|
metaflac = "0.2"
|
|
|
|
|
# CRC32 for the hand-rolled stored-entry zip that builds the pptx and ODF
|
|
|
|
|
# containers. Already in the lockfile transitively via `zip`, so naming it
|
|
|
|
|
# here compiles nothing new.
|
|
|
|
|
crc32fast = "1"
|
|
|
|
|
|
2026-08-09 18:36:47 -04:00
|
|
|
# `harness = false` on both: divan supplies its own `main` via `divan::main()`,
|
|
|
|
|
# so libtest must not also link one in.
|
|
|
|
|
[[bench]]
|
|
|
|
|
name = "search"
|
|
|
|
|
harness = false
|
|
|
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
|
name = "index"
|
|
|
|
|
harness = false
|