mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-17 07:41:23 +01:00
media: add MediaFileKey wrapper
One more win in the fight against the Vec<u8>s
This commit is contained in:
parent
84850a163d
commit
1ccb1e572b
5 changed files with 38 additions and 13 deletions
|
|
@ -24,6 +24,19 @@ pub(crate) struct FileMeta {
|
|||
pub(crate) content_type: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
|
||||
pub(crate) struct MediaFileKey(Vec<u8>);
|
||||
|
||||
impl MediaFileKey {
|
||||
pub(crate) fn new(key: Vec<u8>) -> Self {
|
||||
Self(key)
|
||||
}
|
||||
|
||||
pub(crate) fn as_bytes(&self) -> &[u8] {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct Service {
|
||||
pub(crate) db: &'static dyn Data,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue