Skip to main content

Module file_icons

Module file_icons 

Source
Expand description

The system’s own icons for the Files pane: the picture the operating system shows for a file type, served as a PNG the page draws in a row or tile. docs/specs/SPEC_FILES_SYSTEM_FILE_ICONS_2026_10_27.md.

Phase 1: Windows, by file type (an extension, or a folder). The shell is asked in a helper process (pool) so a misbehaving shell extension can’t take srv down, the answer is kept in memory and on disk (cache), and only the PNG leaves ([crate::server] file_icons). Elsewhere there is no source yet and the route answers 501, which the page reads as “use the built-in icons”.

Modules§

assoc
A fingerprint of whatever decides which icon a file type has, so a changed default app or icon theme makes a new cache entry instead of needing a notification (srv has no window to receive one). Spec §4.4.
cache
Where finished icons are kept: a byte-bounded memory LRU, and a small disk cache so a restart doesn’t ask the shell again (spec §4.4). A type icon’s file name carries a hash of the file associations behind it, so changing a default app makes a new file instead of needing a notification.
child
The helper side of the icon protocol (super::pool): read one request per line from stdin, ask the system, answer on stdout. Ends when stdin closes, which is when srv goes away or kills it.
pool
The helper processes that call the operating system, and the way srv talks to them.
request
What the page may ask the icon route for. Every field is enumerated or validated here, so nothing the page sends reaches the operating system as anything but a file type and a size (spec §4.1, §6).

Enums§

IconError
Why no picture was made.

Constants§

CHILD_ARG
The argument that turns a re-run of srv into the helper (srv __file_icons).

Functions§

icon_png
The PNG of req’s icon: from memory, then disk, then the system.