You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mediarepo/mediarepo-daemon/mediarepo-core/src/type_keys.rs

31 lines
589 B
Rust

use crate::settings::Settings;
use mediarepo_api::types::repo::SizeType;
use std::collections::HashMap;
use std::path::PathBuf;
use tokio_graceful_shutdown::SubsystemHandle;
use typemap_rev::TypeMapKey;
pub struct SettingsKey;
impl TypeMapKey for SettingsKey {
type Value = Settings;
}
pub struct RepoPathKey;
impl TypeMapKey for RepoPathKey {
type Value = PathBuf;
}
pub struct SizeMetadataKey;
impl TypeMapKey for SizeMetadataKey {
type Value = HashMap<SizeType, u64>;
}
pub struct SubsystemKey;
impl TypeMapKey for SubsystemKey {
type Value = SubsystemHandle;
}