Colin Walters
f8852ca945
repo: Add `auto_transaction` and `TransactionGuard`
...
This gives auto-cancelling semantics on `Drop`, plus a nicer
`.commit()` method on the transaction.
Matches the currently private `_OstreeRepoAutoTransaction` in the C
library.
2022-05-06 12:53:57 -04:00
Colin Walters
955f0ddb9d
repo: Expose dfd_as_file()
...
The `dfd()` API returns just an integer. Add a safe API that
makes a copy of the fd. What we really want here is `BorrowedFd` from
https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
but that isn't here yet.
2022-05-06 12:53:57 -04:00
Colin Walters
9b57bda607
Use glib-sys via re-exported `glib::ffi` (and similar for gio)
...
In general only `-sys` crates should depend on other `-sys`
crates. IOW for us, `ostree-sys` depends on `glib-sys`.
By using the re-export, we avoid needing to keep a version lock
between `glib` and `glib-sys` in our main crate. And similar
is true of our higher level reverse dependencies (e.g. `ostree-rs-ext`).
Also weaken our dependency to `0.14` as that's clearer.
2022-05-06 12:53:57 -04:00
Colin Walters
abec2a9e34
Add more documentation for --features=v2021_3
...
My previous pass was at the default feature level.
2022-05-06 12:53:57 -04:00
Colin Walters
48e0d334b8
Deny unused results, warn on missing docs (except auto/)
...
And add basic docs for our manually implemented functions.
2022-05-06 12:53:57 -04:00
Colin Walters
8a5ac02822
Update to glib 0.14
...
An intimidating spam of compiler errors at the start, but the
biggest was handling the new convention of `ostree_sys::` => `ffi::`.
This will require a semver bump of course.
2022-05-06 12:53:56 -04:00
Felix Krull
3290d5c2d1
Rewrite handwritten futures functions
2022-05-06 12:53:55 -04:00
Felix Krull
3e70feb75f
Start taking out futures feature
2022-05-06 12:53:55 -04:00
Felix Krull
7f3bd56d0d
Implement ostree::checksum_file
2022-05-06 12:53:54 -04:00
Felix Krull
4cd981d01b
Use pointer coercion instead of messing with -sys
2022-05-06 12:53:54 -04:00
Felix Krull
e424800f05
Implement Repo::write_metadata_async
2022-05-06 12:53:54 -04:00
Felix Krull
8002e06e25
Implement Repo::write_content_async
2022-05-06 12:53:54 -04:00
Felix Krull
bb4e0c5978
Implement Repo::write_metadata
2022-05-06 12:53:54 -04:00
Felix Krull
78a14d15a3
Implement Repo::write_content
2022-05-06 12:53:54 -04:00
Felix Krull
b5fba187ff
Fix clippy issues
2022-05-06 12:53:54 -04:00
Felix Krull
1e744239cb
Document Repo::new_for_path
2022-05-06 12:53:54 -04:00
Felix Krull
66cf9b288f
Move extra Repo methods to plain impl as well
2022-05-06 12:53:54 -04:00
Felix Krull
60960612a3
Reorganise test code
...
This way I don't need to differentiate between tests for generated code
and tests for hand-written code.
2022-05-06 12:53:53 -04:00
Felix Krull
26b5729c53
Add some tests for Repo
2022-05-06 12:53:53 -04:00
Felix Krull
13c61a9329
Fix features in Repo
2022-05-06 12:53:53 -04:00
Felix Krull
ced47cbb26
Move main crate into repo root
2022-05-06 12:53:53 -04:00