pub struct LocalImageStorage { /* private fields */ }Expand description
Local file-based image storage (used when S3 is not configured)
Implementations§
Source§impl LocalImageStorage
impl LocalImageStorage
pub fn new(base_dir: PathBuf) -> Result<Self>
Sourcepub fn upload_image(
&self,
image_data: &[u8],
content_type: &str,
memory_id: i64,
image_index: i32,
) -> Result<UploadedImage>
pub fn upload_image( &self, image_data: &[u8], content_type: &str, memory_id: i64, image_index: i32, ) -> Result<UploadedImage>
Upload image from bytes
Sourcepub fn upload_from_file(
&self,
file_path: &str,
memory_id: i64,
image_index: i32,
) -> Result<UploadedImage>
pub fn upload_from_file( &self, file_path: &str, memory_id: i64, image_index: i32, ) -> Result<UploadedImage>
Upload image from file path
Sourcepub fn delete_image(&self, key: &str) -> Result<bool>
pub fn delete_image(&self, key: &str) -> Result<bool>
Delete an image
Sourcepub fn delete_memory_images(&self, memory_id: i64) -> Result<i64>
pub fn delete_memory_images(&self, memory_id: i64) -> Result<i64>
Delete all images for a memory
Auto Trait Implementations§
impl Freeze for LocalImageStorage
impl RefUnwindSafe for LocalImageStorage
impl Send for LocalImageStorage
impl Sync for LocalImageStorage
impl Unpin for LocalImageStorage
impl UnsafeUnpin for LocalImageStorage
impl UnwindSafe for LocalImageStorage
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
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.