pub struct GraphicStore { /* private fields */ }Expand description
Reads graphics straight from disk — Core owns no database. Whatever sits
in front of Core (admin routes, or a human with scp) writes (and deletes)
{graphics_storage}/{graphic_id}/... directly; Core only ever reads.
Caches the list() result for a configurable TTL to avoid repeated disk
scans when serving multiple concurrent requests.
Implementations§
Source§impl GraphicStore
impl GraphicStore
pub fn new(root: impl Into<PathBuf>) -> Self
pub async fn get(&self, id: &str) -> Result<Graphic>
pub async fn list(&self) -> Result<Vec<Graphic>>
Auto Trait Implementations§
impl Freeze for GraphicStore
impl RefUnwindSafe for GraphicStore
impl Send for GraphicStore
impl Sync for GraphicStore
impl Unpin for GraphicStore
impl UnsafeUnpin for GraphicStore
impl UnwindSafe for GraphicStore
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