pub struct ImageCache { /* private fields */ }Expand description
Simple in-memory image cache
Implementations§
Source§impl ImageCache
impl ImageCache
pub fn new() -> Self
Sourcepub fn get_or_load(&mut self, url: &str) -> DynamicImage
pub fn get_or_load(&mut self, url: &str) -> DynamicImage
Get image from cache or download it
Sourcepub fn create_bbc_logo() -> DynamicImage
pub fn create_bbc_logo() -> DynamicImage
Create BBC logo placeholder (red rectangle with white BBC text effect)
Auto Trait Implementations§
impl Freeze for ImageCache
impl RefUnwindSafe for ImageCache
impl Send for ImageCache
impl Sync for ImageCache
impl Unpin for ImageCache
impl UnwindSafe for ImageCache
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 more