Crate libpijul [] [src]

Reexports

pub use patch::Patch;
pub use patch::PatchHeader;
pub use signature::KeyPair;

Modules

fs_representation

Layout of a repository (files in .pijul) on the disk. This module exports both high-level functions that require no knowledge of the repository, and lower-level constants documented on pijul.org/documentation/repository, used for instance for downloading files from remote repositories.

graph

The data structures representing contents of a Pijul repository in memory at specific point in time. This representation is used to compute the order on the chunks of a file, possibly detecting conflicts in the process.

patch

Definition of patches, and a number of methods.

signature

Structs

Branch

The representation of a branch. The "application number" of a patch on a branch is the state of the application counter at the time the patch has been applied to that branch.

Edge

The target half of an edge in the repository graph.

EdgeFlags

Possible flags of edges.

Error

The Error type.

Inode

A unique identifier for files or directories in the actual file system, to map "files from the graph" to real files.

Key

A node in the repository graph, made of a patch internal identifier, and a line identifier in that patch.

LineId

An index for file chunks within a patch.

PatchId

An internal patch identifier, less random than external patch identifiers, but more stable in time, and much smaller.

Repository

A repository. All operations on repositories must be done via transactions.

SmallStr

A borrowed version of SmallStr.

SmallString

A string of length at most 255, with a more compact on-disk encoding.

Enums

ErrorKind

The kind of an error.

Hash

The external hash of patches.

HashRef

A borrowed version of Hash.

InodeUpdate
Value

Iterator over parts of a value. On values of size at most 4096 bytes, the iterator will run exactly once. On larger values, it returns all parts of the value, in order.

Constants

DEFAULT_BRANCH

The default name of a branch, for users who start working before choosing branch names (or like the default name, "master").

DELETED_EDGE

An edge whose target (if not also PARENT_EDGE) or source (if also PARENT_EDGE) is marked as deleted.

FOLDER_EDGE

An edge encoding file system hierarchy.

PARENT_EDGE

A "reverse" edge (all edges in the graph have a reverse edge).

PSEUDO_EDGE

A pseudo-edge, computed when applying the patch to restore connectivity, and/or mark conflicts.

ROOT_INODE

The Inode representing the root of the repository (on the actual file system).

ROOT_KEY

The node at the root of the repository graph.

Traits

ResultExt

Additional methods for Result, for easy interaction with this crate.

Transaction

Trait for operations common to mutable and immutable transactions.

Functions

apply_resize

Apply a number of patches, guessing the new repository size. If this fails, the repository size is guaranteed to have been increased by at least some pages, and it is safe to call this function again.

apply_resize_no_output

Apply a number of patches, guessing the new repository size. If this fails, the repository size is guaranteed to have been increased by at least some pages, and it is safe to call this function again.

unrecord_no_resize

Open the repository, and unrecord the patch, without increasing the size. If this fails, the repository file is guaranteed to have been increased by increase bytes.

Type Definitions

ApplyTimestamp

The type of patch application numbers.

MutTxn

A mutable transaction on a repository.

Result

Convenient wrapper around std::Result.

Txn

An immutable transaction on a repository.