pub struct StarStore { /* private fields */ }Implementations§
Source§impl StarStore
impl StarStore
Sourcepub fn global() -> Result<Self, StarStoreError>
pub fn global() -> Result<Self, StarStoreError>
Opens the global star snapshot store.
§Errors
Returns an error if the toolkit cache directory cannot be resolved.
Sourcepub fn load(
&self,
account_id: NonZeroU64,
year: usize,
) -> Result<Option<StarSnapshot>, StarStoreError>
pub fn load( &self, account_id: NonZeroU64, year: usize, ) -> Result<Option<StarSnapshot>, StarStoreError>
Loads the last successful snapshot for an account and edition.
§Errors
Returns an error if an existing snapshot cannot be read or validated.
Sourcepub fn save(
&self,
account_id: NonZeroU64,
snapshot: &StarSnapshot,
) -> Result<(), StarStoreError>
pub fn save( &self, account_id: NonZeroU64, snapshot: &StarSnapshot, ) -> Result<(), StarStoreError>
Atomically replaces the stored snapshot for a verified account and edition.
§Errors
Returns an error if the snapshot cannot be validated, encoded, or saved.
Auto Trait Implementations§
impl Forget for StarStore
impl Freeze for StarStore
impl Move for StarStore
impl RefUnwindSafe for StarStore
impl Send for StarStorewhere
RawVecInner: Send,
impl Sync for StarStorewhere
RawVecInner: Sync,
impl Unpin for StarStore
impl UnsafeUnpin for StarStore
impl UnwindSafe for StarStorewhere
RawVecInner: UnwindSafe,
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