pub struct InputStore { /* private fields */ }Expand description
Puzzle inputs, one file per puzzle under the state directory.
Implementations§
Source§impl InputStore
impl InputStore
Sourcepub fn new(state_dir: impl Into<PathBuf>) -> Self
pub fn new(state_dir: impl Into<PathBuf>) -> Self
Creates a store rooted at the given state directory.
Sourcepub fn path(&self, puzzle: Puzzle) -> PathBuf
pub fn path(&self, puzzle: Puzzle) -> PathBuf
Where a puzzle’s input is kept, whether or not it has been downloaded.
Sourcepub fn holds(&self, puzzle: Puzzle) -> bool
pub fn holds(&self, puzzle: Puzzle) -> bool
Whether this puzzle’s input has already been downloaded.
Sourcepub fn link(&self, puzzle: Puzzle, at: &Path) -> Result<(), Error>
pub fn link(&self, puzzle: Puzzle, at: &Path) -> Result<(), Error>
Points at to this puzzle’s stored input, which InputStore::holds
must already report as present.
Anything already sitting at at is a link left over from an input the
store no longer has, so it is replaced rather than treated as an
obstacle: a state directory that was wiped heals on the next run.
§Errors
Returns Error::Io if the link cannot be created and the input cannot
be copied into its place either.
Trait Implementations§
Source§impl Clone for InputStore
impl Clone for InputStore
Source§fn clone(&self) -> InputStore
fn clone(&self) -> InputStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InputStore
impl RefUnwindSafe for InputStore
impl Send for InputStore
impl Sync for InputStore
impl Unpin for InputStore
impl UnsafeUnpin for InputStore
impl UnwindSafe for InputStore
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