init
Some checks failed
CI / ci (push) Failing after 1m48s

This commit is contained in:
2026-08-25 23:24:36 +02:00
commit 95739892de
466 changed files with 33918 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
use crate::errors::DomainError;
use super::ContentType;
#[derive(Debug, Clone)]
pub struct MediaUpload {
data: Vec<u8>,
content_type: ContentType,
}
impl MediaUpload {
pub fn new(data: Vec<u8>, content_type: ContentType) -> Result<Self, DomainError> {
if data.is_empty() {
return Err(DomainError::InvalidInput(
"media data cannot be empty".into(),
));
}
Ok(Self { data, content_type })
}
pub fn data(&self) -> &[u8] {
&self.data
}
pub fn content_type(&self) -> &ContentType {
&self.content_type
}
pub fn size(&self) -> usize {
self.data.len()
}
}