pub struct ImageProcessor;Trait Implementations§
Source§impl VariantProcessor for ImageProcessor
impl VariantProcessor for ImageProcessor
type ProcessingOptions = ImageOptions
Source§fn get_valid_variants_for_content_type(_content_type: &str) -> Vec<FileVariant>
fn get_valid_variants_for_content_type(_content_type: &str) -> Vec<FileVariant>
Returns a list of valid variants for a given content type
If there are no valid variants for the content type, return an empty list
Source§fn get_content_type_for_variant(
file: &FileDetails,
variant: &FileVariant,
) -> String
fn get_content_type_for_variant( file: &FileDetails, variant: &FileVariant, ) -> String
Returns the content type for a given variant
Source§fn get_options_for_variant(
file: &FileDetails,
variant: &FileVariant,
) -> Result<ImageOptions, DynError>
fn get_options_for_variant( file: &FileDetails, variant: &FileVariant, ) -> Result<ImageOptions, DynError>
Returns the processing options for a given variant
If there are no options for this variant, return an error
Source§fn process<'life0, 'life1, 'life2, 'async_trait>(
origin_file_path: &'life0 str,
output_file_path: &'life1 str,
options: &'life2 ImageOptions,
) -> Pin<Box<dyn Future<Output = Result<String, DynError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn process<'life0, 'life1, 'life2, 'async_trait>(
origin_file_path: &'life0 str,
output_file_path: &'life1 str,
options: &'life2 ImageOptions,
) -> Pin<Box<dyn Future<Output = Result<String, DynError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Processes the origin file and saves the output to the output_file_path based on the passed options
Returns the content type of the processed file or the original content type if no processing was done
Source§fn create_variant<'life0, 'life1, 'async_trait>(
file: &'life0 FileDetails,
variant: &'life1 FileVariant,
file_path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<String, DynError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn create_variant<'life0, 'life1, 'async_trait>(
file: &'life0 FileDetails,
variant: &'life1 FileVariant,
file_path: PathBuf,
) -> Pin<Box<dyn Future<Output = Result<String, DynError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Creates a variant for the given file
If there are no options for this variant, return with the original content type
Auto Trait Implementations§
impl Freeze for ImageProcessor
impl RefUnwindSafe for ImageProcessor
impl Send for ImageProcessor
impl Sync for ImageProcessor
impl Unpin for ImageProcessor
impl UnsafeUnpin for ImageProcessor
impl UnwindSafe for ImageProcessor
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<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request