1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-08-04 11:43:58 +00:00
continuwuity/src/service/media/data.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
915 B
Rust
Raw Normal View History

2022-09-07 13:25:51 +02:00
use crate::Result;
pub trait Data: Send + Sync {
2022-10-05 20:34:31 +02:00
fn create_file_metadata(
&self, sender_user: Option<&str>, mxc: String, width: u32, height: u32, content_disposition: Option<&str>,
content_type: Option<&str>,
2022-10-05 20:34:31 +02:00
) -> Result<Vec<u8>>;
fn delete_file_mxc(&self, mxc: String) -> Result<()>;
2022-09-07 13:25:51 +02:00
/// Returns content_disposition, content_type and the metadata key.
2022-10-05 20:34:31 +02:00
fn search_file_metadata(
&self, mxc: String, width: u32, height: u32,
) -> Result<(Option<String>, Option<String>, Vec<u8>)>;
fn search_mxc_metadata_prefix(&self, mxc: String) -> Result<Vec<Vec<u8>>>;
fn get_all_media_keys(&self) -> Result<Vec<Vec<u8>>>;
// TODO: use this
#[allow(dead_code)]
fn remove_url_preview(&self, url: &str) -> Result<()>;
fn set_url_preview(&self, url: &str, data: &super::UrlPreviewData, timestamp: std::time::Duration) -> Result<()>;
fn get_url_preview(&self, url: &str) -> Option<super::UrlPreviewData>;
2022-09-07 13:25:51 +02:00
}