Commit Graph

33 Commits

Author SHA1 Message Date
Jakub Koralewski 6310b21632 feat: given move, also move back
if we're breaking public api already, might as well return the integrity object for possible re-use
2025-11-20 17:30:46 +00:00
Jakub Koralewski 89457c054a feat: allow to read key without checking integrity 2025-11-20 17:13:09 +00:00
Qing Lei 34ee679816
feat(remove_fully): add option for remove cache entry (#54)
Fixes: https://github.com/zkat/cacache-rs/issues/53
2023-10-07 12:39:30 -07:00
Kat Marchán 6062226789
feat(sync-only): add support for removing async runtime dependency altogether (#56) 2023-09-11 12:15:16 -07:00
Michal Trybus 2c98f08a98
feat(deps) re-exported ssri::Integrity (#52) 2023-07-03 08:51:28 -07:00
Scott Haug ac56fd9ce6
feat(link_to): Add support for linking to existing files from the cache (#41) 2023-02-27 14:08:01 -08:00
Kat Marchán 9991f56b4c
feat(index): Add support for raw index metadata and expose index functions 2023-02-19 01:18:29 -08:00
Kat Marchán 7104df66dd
misc: update warning name 2023-01-28 15:55:00 -08:00
C J Silverio e34dcfdc25
feature(async): Add tokio as an executor option (#36)
This PR is based on the work @alexschrod did in PR #29. All
I did was carry it over the finish line.

This PR adds a feature to the crate named `tokio-runtime`. If
you disable default features and enable this new one, cacache
uses tokio as its async executor. This makes integrating cacache
with tokio-using projects easier, because the file types leak out
if you use anything more than the top-level convenience functions.

The PR implements the feature using shims in a new submodule named
`async_lib`. This module conditionally uses either async-std
or tokio based on feature selection, and hides some differences with
convenience functions.

This change should not be a breaking change, because the default is
still async-std.

There are a few other small changes in this PR worth noting.

- The README shows how to switch runtimes.
- There's a justfile to run common tasks, including those in makefile.toml.
  The default shell is `sh`, so this might not work out of the box for
  Windows users.
- The tests can now run under either runtime. The justfile has a recipe
  that runs them both.
- The benchmarks can also run under either runtime. The justfile has two
  recipe for this, one using bench and the other using criterion's runner.
- The dependencies now pull in async-attributes by default along with
  async-std. This made it easier to swap runtimes in the tests.
- All dependency versions have been bumped.

Co-authored-by: @alexschrod
2023-01-28 13:01:59 -08:00
Florian Albertz bb815f5f22 feat(errors): remove anyhow and use custom error types (#24)
Co-authored-by: Florian Albertz <git@albertz.io>

BREAKING CHANGE: This changes the exported error type(s) for cacache, making it way easier to do error handling when something goes kaput.
2020-04-29 19:34:43 -07:00
Kat Marchán 743476b274
feat(api): rewrite entire API to be like std::fs (#21)
Fixes: #13

BREAKING CHANGE: The entire API surface has been rewritten and overhauled. Instead of breaking up the package into get/put/rm/ls modules, everything is now available mostly through the toplevel module, following the same conventions as std:fs for its operations. Associated structs and other types have also been renamed. Please refer to the documentation for the new API, and I hope you find it more ergonomic!
2019-10-23 21:17:57 -07:00
Kat Marchán ee149a70ca
feat(errors): Replace failure with anyhow crate (#17)
Fixes: #14

BREAKING CHANGE: Result functions now return anyhow::Error
2019-10-20 00:25:28 -04:00
Kat Marchán ef8d3ad0e7
docs: improve root examples a bit 2019-10-18 21:49:32 -04:00
Kat Marchán 662aea9b5a feat(async): reorganize async APIs to be the primary APIs
BREAKING CHANGE: the async_* namespaces are gone, and all the previously-sync APIs (get::data, put::data, etc), are all suffixed with _sync now. You'll need to adjust your usage accordingly.
2019-10-17 18:25:20 -04:00
Kat Marchán 4259a39fdf
docs: add basic examples 2019-10-15 13:08:02 -04:00
Kat Marchán 4d9404b9a6
feat(license): relicense to Parity+Apache 2019-10-15 12:15:34 -04:00
Kat Marchán 18190bfc35
feat(async): add extra async versions of APIs (#6) 2019-10-13 20:06:20 -04:00
Kat Marchán 473473e6b2
feat(license): relicense under MPL-2.0 (#8)
BREAKING CHANGE: The license terms have changed. Please refer to LICENSE in the root of this repository for details. Future use of this library may require release of source code for any changes applied to it.
2019-09-06 21:39:36 -07:00
Félix Saparelli ad74518a9d refactor(index): idiomatise various iterators (#1)
* chore(index): idiomatise variously

* chore(index): exploit hashset to dedupe entries

* chore(index): format
2019-07-01 08:46:08 -07:00
Kat Marchán 87adc8cf9f
feat(exports): re-export ssri::Algorithm and serde_json::Value 2019-06-30 23:20:57 -07:00
Kat Marchán 329aee2205
meta(doc): increase doc-linting level 2019-06-30 23:20:34 -07:00
Kat Marchán bc56a1b3fe
fix(fmt): cargo fmt 2019-06-26 21:41:44 -07:00
Kat Marchán b0f351ea26
feat(ls): implemented cacache::ls::all() 2019-06-05 23:58:32 +02:00
Kat Marchán b54a3a4f82
misc: sort mod declarations in lib.rs 2019-06-05 14:09:58 +02:00
Kat Marchán 261f190e4e
doc: added some basic top-level documentation. 2019-06-05 14:00:25 +02:00
Kat Marchán 346cf5fb23
feat(rm): added external rm api 2019-06-05 13:41:32 +02:00
Kat Marchán 815d7a3c9e
feat(put): initial implementation of cacache::put 2019-06-05 11:44:29 +02:00
Kat Marchán d91d214176
feat(get): add external cacache::get api 2019-06-04 22:06:38 +02:00
Kat Marchán c14980800b
exports: stop exporting content internals 2019-05-26 21:27:37 -07:00
Kat Marchán eac29d941b
feat(rm): added content/rm 2019-05-24 17:14:06 -07:00
Kat Marchán e452fdcd16
feat(write): initial hack for write 2019-05-22 19:42:17 -07:00
Kat Marchán e98bfb17da
feat(content): add baseline read functionality 2019-05-20 18:11:58 -07:00
Kat Marchán 0f768fa5c0
feat(path): ported content_path 2019-05-20 17:34:29 -07:00