media: add MediaFileKey wrapper

One more win in the fight against the Vec<u8>s
This commit is contained in:
Lambda 2024-08-11 17:11:48 +00:00
parent 84850a163d
commit 1ccb1e572b
5 changed files with 38 additions and 13 deletions

View file

@ -1,3 +1,4 @@
use super::MediaFileKey;
use crate::Result;
pub(crate) trait Data: Send + Sync {
@ -8,7 +9,7 @@ pub(crate) trait Data: Send + Sync {
height: u32,
content_disposition: Option<&str>,
content_type: Option<&str>,
) -> Result<Vec<u8>>;
) -> Result<MediaFileKey>;
/// Returns `content_disposition`, `content_type` and the `metadata` key.
fn search_file_metadata(
@ -16,5 +17,5 @@ pub(crate) trait Data: Send + Sync {
mxc: String,
width: u32,
height: u32,
) -> Result<(Option<String>, Option<String>, Vec<u8>)>;
) -> Result<(Option<String>, Option<String>, MediaFileKey)>;
}