Skip to main content

Crate ostrya

Crate ostrya 

Source
Expand description

An async, pure-Rust library that reads and writes ostree repositories.

A user opens a repository, writes commits in transactions, reads and checks out trees, and pulls, pushes, signs, and prunes. The bytes on disk are the bytes that the ostree command writes. Many Transactions can write to one repository at once in one process.

As an extension, the crate also has a push protocol over HTTP and over ssh. With the push feature, Repo::push sends commits to a remote. With the receive feature, the receive module takes a push on the server side.

§Entry points

§Modules

§Features

  • smol (default): the smol backend of ostrya-rt.
  • tokio: the tokio backend of ostrya-rt.
  • sign-spki: the spki module, the spki signing engine.
  • verify-gpg: the gpg module, GPG verification and keyring management.
  • sign-gpg: GpgSigner, which signs with the gpg command. It turns on verify-gpg.
  • receive: the receive module, the receive side of a push.
  • push: Repo::push and Repo::export_stream, the push from a repository.
  • lzma-static: xz built from source and linked statically, with no runtime liblzma.

§Examples

let repo = ostrya::Repo::open("/srv/repo".as_ref()).await?;
let tip = repo.resolve_rev("exampleos/stable", false).await?;

Re-exports§

pub use ostrya_fetch as fetch;
pub use ostrya_remote as remote;

Modules§

archive
The archive view of a repository.
base64
Standard base64 (RFC 4648) for byte strings of any length.
bootable
The kernel version of a bootable commit, and the metadata pair that holds it.
checkout
The checkout of a committed tree into a directory on the file system.
commit
Commit objects and the detached metadata of a commit.
composefs
Export of a commit as a composefs EROFS image.
config
The typed view of the repository config file.
diff
The comparison of two trees.
endpoint
The resolution of a remote to an Endpoint.
error
The error type of this crate.
file
Read access to file objects: their metadata and their payload.
fsck
Checks of the integrity and the completeness of a repository.
gpgverify-gpg
GPG (OpenPGP) signature verification, keyring management, and signing.
modifier
The commit modifier: the options that shape the ingest of a directory.
mtree
Directory trees built in memory and written as dirtree objects.
prune
Removal of unreachable objects.
pull
Pulls of refs and their objects from another repository.
read
Reads of metadata objects and of the state of a commit.
receivereceive
The receive side of a push: the policy and the sessions of a server.
refs
Ref resolution, listing, and writes.
repo
The repository handle and the options of a new repository.
sign
Commit signatures, the signing engines, and the key store.
spkisign-spki
The spki signing engine: ECDSA signatures on P-256 with SPKI public keys.
staging_tree
Construction of a tree by path inside a transaction.
summary
The summary of a repository: the summary file and its signatures.
tar
Tar import and export.
transaction
Transactions: the write path of a repository.
traverse
Walks of the objects that commits reach, and listings of loose objects.
tree
The read-only walk of the file tree of a commit.
update
The update guard: an exclusive hold on the writes of refs and config.
verify
The trusted keys and the trust of one pull.

Structs§

Checksum
A 32-byte SHA-256 checksum that names an object.
Commit
An owned commit object.
DeltaFallback
An object that a static delta delivers as a loose object, outside its parts.
DeltaOpCounts
The number of operations of each opcode in the operation stream of a part.
DeltaOptions
The options of Repo::generate_static_delta.
DeltaPart
The meta-entry of one part of a static delta.
DeltaPartStats
The table sizes, the blob size, and the operation counts of one part.
DeltaSuperblock
A parsed static-delta superblock.
DictBuilder
A builder for an a{sv} dict value.
DirMeta
An owned dirmeta object: the owner, the mode, and the xattrs of a directory.
DirTree
An owned dirtree object: the lists of child files and subdirectories.
ExportStreamOptionspush
The options of Repo::export_stream.
HashingReader
An async reader that hashes every byte that it yields.
HashingWriter
An async writer that hashes every byte that it forwards.
Image
A composefs EROFS image in memory, with its fs-verity digest.
ObjectName
A checksum and the type of the object that it identifies.
RefPattern
One ref pattern, with no !.
RefSelector
A list of positive and negative RefPatterns.
RepoPushOptionspush
The options of Repo::push and Repo::push_over_stream.
Span
A half-open byte range of the input text that a TextError names.
TextError
The error for a GVariant text form that from_text refuses.
VerifyingReader
An async reader that verifies a stream against an expected checksum.
Xattrs
A sorted set of extended attributes, in canonical form.

Enums§

DeltaEndianness
The byte order of the host-order size fields of a superblock.
LockKind
The kind of hold on the repository lock: shared or exclusive.
ObjectType
A repository object type.
RepoMode
The on-disk storage mode of a repository.
Type
A GVariant type.
Value
A dynamically typed GVariant value.

Constants§

MAX_METADATA_SIZE
The size limit of a metadata object: 128 MiB.
MAX_REF_ENTRY_LEN
The most bytes in one entry of a ref listing request: 4,096.
MAX_REF_ENTRY_PARTS
The most parts in one entry of a ref listing request: 256.
MAX_REF_LISTING
The largest ref listing: 128 MiB.
MAX_REF_PATTERNS
The most entries in one request of a ref listing: 256.

Functions§

from_bytes
Deserializes normal-form GVariant bytes of type ty into a Value.
from_text
Reads one GVariant text form and returns the type it states and the value.
is_checksum_shaped
Returns true if name is 64 lowercase hex characters.
is_push_addresspush
Returns true if remote is a push address: a value with a : or a /.
loose_path
Returns the loose path of an object for a repository mode.
reap_process_staging
Removes the staging directories of the live transactions of this process.
static_delta_relative_dir
Returns the directory of a delta, relative to the repository root.
to_text
Renders value of type ty in the GVariant text form.
to_text_unannotated
Renders value of type ty in the GVariant text form with no annotations.