Skip to main content

Module media_files

Module media_files 

Source
Expand description

The files of mediaid_file rows in the media directory.

A row’s file is named by the base64 of its key’s SHA-256 digest, or under the legacy naming by the base64 of the key itself. One check covers the rename from legacy names, the other the directory once that rename is stamped.

Re-exportsΒ§

use std::collections::HashSet; πŸ”’
use std::ffi::OsString; πŸ”’
use std::fmt; πŸ”’
use std::fs::Metadata; πŸ”’
use std::fs::read_dir; πŸ”’
use std::io; πŸ”’
use std::io::ErrorKind; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use futures::Stream; πŸ”’
use futures::TryStreamExt; πŸ”’
use futures::stream::once; πŸ”’
use tuwunel_core::Err; πŸ”’
use tuwunel_core::Result; πŸ”’
use tuwunel_core::err; πŸ”’
use tuwunel_core::itertools::Itertools; πŸ”’
use tuwunel_core::utils::BoolExt; πŸ”’
use tuwunel_core::utils::TryReadyExt; πŸ”’
use tuwunel_core::utils::stream::TryBroadbandExt; πŸ”’
use tuwunel_database::KeyBuf; πŸ”’
use super::Check; πŸ”’
use super::Report; πŸ”’
use super::ScanExt; πŸ”’
use super::tally; πŸ”’
use crate::Services; πŸ”’
use crate::migrations::SHA256_MEDIA; πŸ”’
use crate::migrations::marker_present; πŸ”’

StructsΒ§

Entry πŸ”’
A row’s legacy name, and which of its two names the directory lists.
Legacy
A mediaid_file row whose media is still a file under its legacy name.

EnumsΒ§

Finding
A mediaid_file row the media directory disagrees with.

StaticsΒ§

CHECK πŸ”’
LEGACY πŸ”’

FunctionsΒ§

classify πŸ”’
Judges one row as the startup media check does, reading the legacy name’s kind only where the check would.
entries πŸ”’
entry πŸ”’
files πŸ”’
Lists the media directory once the sha256 rename is stamped.
is_link πŸ”’
keys πŸ”’
legacy
Streams each mediaid_file row whose media is still a file under its legacy name, only while the sha256 rename is unstamped.
listing πŸ”’
Lists the media directory, naming each entry by dir joined with its name.
scan
Streams each mediaid_file row the media directory disagrees with, only once the sha256 rename is stamped.
unrenamed πŸ”’

Type AliasesΒ§

Files πŸ”’