PronounsToday/src/user_preferences/v0.rs

36 lines
792 B
Rust

//! Version 0 Prefstrings
use crate::{
InstanceSettings,
Pronoun,
user_preferences::Preference,
WeightedTable,
};
use std::collections::HashMap;
/// A parsed version of the V0 prefstring
///
/// See the [prefstring specification][1] for more information about how this is interpretted.
///
/// [1]: https://fem.mint.lgbt/Emi/PronounsToday/raw/branch/main/doc/User-Preference-String-Spec.txt
pub struct UserPreferencesV0<'a> {
default_weight: u8,
default_enabled: bool,
overrides: HashMap<&'a Pronoun, u8>,
}
impl<'a> Preference<'a> for UserPreferencesV0<'a> {
fn into_weighted_table(&self) -> WeightedTable {
todo!()
}
fn from_prefstring_bytes(bytes: &[u8], settings: &'a InstanceSettings) -> Self {
todo!()
}
fn into_prefstring_bytes(&self) -> Vec<u8> {
todo!()
}
}