style: cargo fmt --all

This commit is contained in:
2026-05-31 05:31:42 +02:00
parent 4b31a0f74b
commit c2ebca0da0
138 changed files with 2422 additions and 1164 deletions

View File

@@ -1,10 +1,10 @@
use async_trait::async_trait;
use super::entities::{
Asset, AssetMetadata, AssetStack, DerivativeAsset, DerivativeProfile, DuplicateGroup,
MetadataSource,
};
use crate::common::errors::DomainError;
use crate::common::value_objects::{Checksum, SystemId};
use super::entities::{
Asset, AssetMetadata, AssetStack, DerivativeAsset, DerivativeProfile,
DuplicateGroup, MetadataSource,
};
use async_trait::async_trait;
// --- AssetRepository ---
@@ -12,7 +12,12 @@ use super::entities::{
pub trait AssetRepository: Send + Sync {
async fn find_by_id(&self, id: &SystemId) -> Result<Option<Asset>, DomainError>;
async fn find_by_checksum(&self, checksum: &Checksum) -> Result<Vec<Asset>, DomainError>;
async fn find_by_owner(&self, owner_id: &SystemId, limit: u32, offset: u32) -> Result<Vec<Asset>, DomainError>;
async fn find_by_owner(
&self,
owner_id: &SystemId,
limit: u32,
offset: u32,
) -> Result<Vec<Asset>, DomainError>;
async fn save(&self, asset: &Asset) -> Result<(), DomainError>;
async fn delete(&self, id: &SystemId) -> Result<(), DomainError>;
}
@@ -22,9 +27,17 @@ pub trait AssetRepository: Send + Sync {
#[async_trait]
pub trait AssetMetadataRepository: Send + Sync {
async fn find_by_asset(&self, asset_id: &SystemId) -> Result<Vec<AssetMetadata>, DomainError>;
async fn find_by_asset_and_source(&self, asset_id: &SystemId, source: MetadataSource) -> Result<Option<AssetMetadata>, DomainError>;
async fn find_by_asset_and_source(
&self,
asset_id: &SystemId,
source: MetadataSource,
) -> Result<Option<AssetMetadata>, DomainError>;
async fn save(&self, metadata: &AssetMetadata) -> Result<(), DomainError>;
async fn delete_by_asset_and_source(&self, asset_id: &SystemId, source: MetadataSource) -> Result<(), DomainError>;
async fn delete_by_asset_and_source(
&self,
asset_id: &SystemId,
source: MetadataSource,
) -> Result<(), DomainError>;
}
// --- AssetStackRepository ---
@@ -41,8 +54,13 @@ pub trait AssetStackRepository: Send + Sync {
#[async_trait]
pub trait DerivativeRepository: Send + Sync {
async fn find_by_asset(&self, asset_id: &SystemId) -> Result<Vec<DerivativeAsset>, DomainError>;
async fn find_by_asset_and_profile(&self, asset_id: &SystemId, profile: DerivativeProfile) -> Result<Option<DerivativeAsset>, DomainError>;
async fn find_by_asset(&self, asset_id: &SystemId)
-> Result<Vec<DerivativeAsset>, DomainError>;
async fn find_by_asset_and_profile(
&self,
asset_id: &SystemId,
profile: DerivativeProfile,
) -> Result<Option<DerivativeAsset>, DomainError>;
async fn save(&self, derivative: &DerivativeAsset) -> Result<(), DomainError>;
async fn delete(&self, id: &SystemId) -> Result<(), DomainError>;
}