pub struct ConversionService { /* private fields */ }Expand description
Service for managing file format conversions.
Implementations§
Source§impl ConversionService
impl ConversionService
pub fn new( conversion_repo: Arc<ConversionJobRepository>, file_repo: Arc<StoredFileRepository>, ) -> Self
Sourcepub async fn request_conversion(
&self,
source_file_id: Uuid,
target_format: &str,
options: Option<Value>,
) -> ServiceResult<ConversionJob>
pub async fn request_conversion( &self, source_file_id: Uuid, target_format: &str, options: Option<Value>, ) -> ServiceResult<ConversionJob>
Request a format conversion for a file.
Sourcepub async fn mark_started(&self, job_id: Uuid) -> ServiceResult<ConversionJob>
pub async fn mark_started(&self, job_id: Uuid) -> ServiceResult<ConversionJob>
Mark a conversion job as started.
Sourcepub async fn update_progress(
&self,
job_id: Uuid,
progress: i32,
) -> ServiceResult<ConversionJob>
pub async fn update_progress( &self, job_id: Uuid, progress: i32, ) -> ServiceResult<ConversionJob>
Update conversion progress (0-100).
Sourcepub async fn mark_completed(
&self,
job_id: Uuid,
result_file_id: Uuid,
) -> ServiceResult<ConversionJob>
pub async fn mark_completed( &self, job_id: Uuid, result_file_id: Uuid, ) -> ServiceResult<ConversionJob>
Mark a conversion job as completed with the result file.
Sourcepub async fn mark_failed(
&self,
job_id: Uuid,
error_message: &str,
) -> ServiceResult<ConversionJob>
pub async fn mark_failed( &self, job_id: Uuid, error_message: &str, ) -> ServiceResult<ConversionJob>
Mark a conversion job as failed with an error message.
Auto Trait Implementations§
impl !RefUnwindSafe for ConversionService
impl !UnwindSafe for ConversionService
impl Freeze for ConversionService
impl Send for ConversionService
impl Sync for ConversionService
impl Unpin for ConversionService
impl UnsafeUnpin for ConversionService
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.