chore: refactor into a RecordingDataManager, lay the ground work for a RenderManager

This commit is contained in:
2026-05-27 01:28:47 -04:00
parent f86c094dda
commit e72633f26a
22 changed files with 830 additions and 49 deletions

View File

@@ -0,0 +1,26 @@
use snafu::{OptionExt as _, ResultExt as _, Snafu};
use std::num::ParseIntError;
use std::str::FromStr;
use twilight_model::id::Id;
use twilight_model::id::marker::ChannelMarker;
pub type VoiceChannel = Id<ChannelMarker>;
#[derive(Debug, Snafu)]
pub enum TakeError {
/// voice channels are supposed to be followed by -
Malformed,
/// could not parse the voice channel ID
ParseIdError {
source: <VoiceChannel as FromStr>::Err,
},
}
pub fn take(path: &str) -> Result<(VoiceChannel, &str), TakeError> {
let (voice_channel, rest) = path.split_once('-').context(MalformedSnafu)?;
let voice_channel = voice_channel.parse().context(ParseIdSnafu)?;
Ok((voice_channel, rest))
}