pub struct ImageServer {
pub config: Config,
pub state: Arc<RwLock<ServerState>>,
}
Expand description
The main server structure
Fields§
§config: Config
§state: Arc<RwLock<ServerState>>
Implementations§
Source§impl ImageServer
impl ImageServer
Sourcepub fn with_config(config: Config) -> Self
pub fn with_config(config: Config) -> Self
Create a new ImageServer
instance with custom configuration
Sourcepub async fn populate_cache(&self)
pub async fn populate_cache(&self)
Populate the cache with the configured images
§Errors
Returns an error if the image file does not exist, is not a file, or has an unsupported extension.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageServer
impl !RefUnwindSafe for ImageServer
impl Send for ImageServer
impl Sync for ImageServer
impl Unpin for ImageServer
impl !UnwindSafe for ImageServer
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