Skip to main content

Module media

Module media 

Source
Expand description

Media Vector shows without writing it down: decrypted bytes held in memory per account (ram), read through one interface whatever holds them.

Modules§

import
Files downloaded before the store, moved into it: checked against their hash, sealed under fresh parameters, then taken out of the download folder. Resumable by construction: a file is either still a download on disk or already the store’s. An original goes only once its kept copy has been read back whole and the database that points at it is on disk.
pending
A send’s own bytes, for its bubble while it goes out: the sender’s file until it’s sealed, then the sealed copy waiting to upload or to retry. Per session, never stored.
ram
Decrypted media held in memory, one cache per account session.
range
One HTTP Range header against a known length, for every place that serves media.
store
Files this account keeps, as the ciphertext they arrived as, under <account>/media/. The ledger (db::media_store) holds each file’s key; nothing here is ever plaintext.

Structs§

Reader
A cursor over a source, for readers that want Read + Seek.

Enums§

MediaRef
How a command names an attachment’s bytes: a hash this account holds, or a file.

Traits§

MediaSource
Bytes a media view reads, wherever they live.

Functions§

held_bytes
The plaintext and type of media this account holds, from memory or the store. A kept file read on the web is held in memory after, since its store can’t be read a range at a time.
keep_media
“Keep Files on This Device”: every file received is kept in the store too, not only held.
keep_unencrypted
“Keep Unencrypted”: what is kept is a plain file in the public folder, not sealed in the store.
open
What holds hash for this account right now, memory first, if anything.
openable
Whether hash is held, or open would find it as a plain copy in a download folder.
previewable
Kinds a chat bubble draws itself: these load for viewing without being kept.
read
The bytes behind a path or a vmedia: ref, for readers that want the whole file.
read_all
Every byte of src, for a reader that wants the whole file.
reader
resident
Whether this account can show hash without fetching it.
url_key
The memory key of media fetched by URL rather than by content hash: kind keeps one kind’s keys apart from another’s. The digest is masked so that no file’s content hash can be it: a file of exactly the derivation’s bytes would otherwise claim the link’s slot.