//! Bytes: where this Mac keeps them, and how they leave.//!//! Two halves, and they are deliberately separate. [`store`] is the device's own//! content-addressed copy — permanent, never evicted, the thing that makes an//! import work with the network off. [`drain`] is the ledger walking those bytes//! up to the bucket in the background, for ever, with a backoff and no attempt//! ceiling.//!//! [`transport`] is the third: the person's object's media door, which the//! drain puts through (`PUT /v1/media/<key>`, or the file in parts) and the//! hydrator reads through (`GET /v1/media/<key>`).//!//! [`evict`] is the fifth, and it is the only one that DELETES: the budgeted//! phone cache, taking viewed originals off this device least-recently-viewed//! first when the media store outgrows what the person allows it. **Never a//! thumbnail, never a capture this device made, and never the last copy of//! anything.**//!//! What is NOT here: a path answered ACROSS the boundary. A read answers a//! PATH and Swift reads the file itself (design M4) — no renderer, no scheme,//! no bytes across the FFI boundary at all./// The keys the object answered 404 for, waiting before they are asked again.pubmod absent;pubmod drain;/// The BUDGET: viewed originals leaving this device to make room, never a/// thumbnail and never the last copy of anything.pubmod evict;pubmod fetching;pubmod storage;/// The mirror image of the drain: originals coming DOWN, until two live devices/// hold each one.pubmod hydrate;pubmod keep_fetch;pubmod network;/// A person's own files sealed going up and opened coming down (R6).pubmod sealed;/// A sealed file read where the object keeps it, a range at a time (R6).pubmod remote;/// The phone's own player door: a sealed file opened as it plays (R6).pubmod lan;pubmod loopback;/// This device's own holds, named by its device key.pubmod holds;pubmod store;pubmod transport;/// The bytes of erased records leaving this device (slice 7).pubmod unlink;/// A copy of a Photos original leaving once the object holds it (KEEP 1e).pubmod release;/// Where each queued file is: the ledger's answer and the uploads in the air.pubmod uploads;pubuse uploads::{uploads_of, FileUpload, Flight, Phase, UploadCounts, UploadWatch, Uploads};pubuse drain::{ carry_bytes, carry_bytes_watched, refusal_code, Progress, counts_of, drain_pass, finish_upload, is_dead_key_refusal, is_terminal_refusal, plan_upload, DrainPass, DrainState, Landed, MediaDrain, MediaDrainDeps, MediaDrainInput,MediaDrainStatus, MediaMoved, MediaMovedListener, UploadPlan, Uploaded, MEDIA_DRAIN_BATCH, MEDIA_DRAIN_CONCURRENCY, MEDIA_DRAIN_INTERVAL_MS,};pubuse evict::{ evict_pass, read_budget, set_budget, EvictPass, EvictSweep, OtherReplicas, MediaEvictDeps, StoredBudget,SystemEvictDisk, EVICT_BATCH, MEDIA_BUDGET_CHOICES, MEDIA_BUDGET_DEFAULT_BYTES, THUMB_CEILING_BYTES, THUMB_CEILING_WARNING,};pubuse hydrate::{ free_bytes_at, hydrate_every, hydrate_pass, room_left, work_list, DiskRoom, HydratePass, MediaHydrateDeps,Policy, DISK_UNREAD, HYDRATE_BATCH, HYDRATE_DISK_FLOOR_BYTES, REPLICATION_HOLDERS,};pubuse store::{file_size_of, media_file_path, put_media_file, sha256_file, StoredMediaFile};pubuse unlink::{bytes_are_dead, objects_of_dead_key, unlink_pass, UnlinkPass, UnlinkSweep};pubuse transport::{ObjectMediaTransport, StreamGrant, PART_BYTES};/// Thumbnail query shapes derived from the canonical key builders.pubfn thumb_key_shapes(file: &cotton_store::file_identity::FileId) -> (cotton_store::media_thumbs::KeyShape, cotton_store::media_thumbs::KeyShape) {use cotton_core::media::keys::{photo_thumb_key, video_thumb_key};use cotton_store::media_thumbs::KeyShape;let sentinel = "0".repeat(64);let split = |key: String| {let (prefix, suffix) = key.split_once(&sentinel).expect("thumbnail key contains its digest");KeyShape::new(prefix, suffix) }; (split(photo_thumb_key(file, &sentinel)), split(video_thumb_key(file, &sentinel)))}