Struct torrust_index_backend::cache::image::manager::ImageCacheService
source · pub struct ImageCacheService { /* private fields */ }
Implementations§
source§impl ImageCacheService
impl ImageCacheService
pub async fn new(cfg: Arc<Configuration>) -> Self
sourcepub async fn get_image_by_url(
&self,
url: &str,
opt_user: Option<UserCompact>
) -> Result<Bytes, Error>
pub async fn get_image_by_url( &self, url: &str, opt_user: Option<UserCompact> ) -> Result<Bytes, Error>
Get an image from the url and insert it into the cache if it isn’t cached already. Unauthenticated users can only get already cached images.
Errors
Return a Error::Unauthenticated
if the user has not been authenticated.
Auto Trait Implementations§
impl !RefUnwindSafe for ImageCacheService
impl Send for ImageCacheService
impl Sync for ImageCacheService
impl Unpin for ImageCacheService
impl !UnwindSafe for ImageCacheService
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