ostrya 0.12.1

Pure-Rust async reimplementation of the ostree repository library
Documentation
//! The receive side of a push: the policy and the sessions of a server.
//!
//! This module needs the `receive` feature. These are its entry items:
//!
//! - [`ReceivePolicy`] states what a push session of one client group can
//!   read and change, and how the server verifies and signs its commits.
//!   [`ReceivePolicies::from_config`] builds the policy of each client group
//!   of the repository config. [`TrustedKeys`] holds the keys that a policy
//!   verifies a commit against.
//! - [`Repo::receive`](crate::Repo::receive) runs one push session over a
//!   pair of streams. Its doc lists the checks of `Commit` in order.
//! - [`ReceiveService`] runs a push session as steps, one step for each
//!   request of a transport such as HTTP. [`ReceiveService::commit`] states
//!   the condition of each wire code of `Commit`.
//! - [`ReceiveHooks`] are the calls of the host that run before and after the
//!   ref update of a session.
//! - [`Repo::receive_stream`](crate::Repo::receive_stream) reads one one-way
//!   stream: the messages of a session in one direction, with no reply.
//!   [`Repo::receive_stream_to_commit`](crate::Repo::receive_stream_to_commit)
//!   reads it and stops at `Commit`, for a channel with no end of input. A
//!   [`StreamPolicy`] states what the stream accepts.
//! - [`ClientAccess`] reads the client groups and the server settings. The
//!   module re-exports it and the other types of [`access`](crate::access).

mod ancestry;
mod core;
mod finish;
mod hooks;
mod ingest;
mod merge;
mod policy;
mod reader;
mod server_commit;
mod service;
mod session;
mod stream;
mod stream_policy;
mod trust;
mod walk;

pub use crate::access::{
    AccessModes, AccessRules, AllowItem, AuthItem, ClientAccess, ClientGroup, IpNet, Namespace,
    NamespaceRules, ServerFile, ServerSettings, ServerTlsFiles,
};
pub use crate::pattern::ReceivePattern;
pub use crate::verify::TrustedKeys;
pub use hooks::{
    HookFuture, HookRefusal, HostEntry, ReceiveHooks, ReceiveRefUpdate, ReceiveServerCommit,
    UpdatePlan,
};
pub use policy::{ReceivePolicies, ReceivePolicy, ReceiveVerify};
pub use service::ReceiveService;
pub use session::{ReceiveCommit, ReceiveRefOutcome, ReceiveReport, ReceiveStep, ReceiveWarning};
pub use stream_policy::{StreamPolicy, StreamRule};

pub(crate) use merge::merge_detached;

/// The receive types move freely across tasks and threads, so one policy can
/// serve every session of a server.
const _: fn() = || {
    fn assert_send_sync<T: Send + Sync>() {}
    assert_send_sync::<ReceivePolicy>();
    assert_send_sync::<ReceivePolicies>();
    assert_send_sync::<ReceiveVerify>();
    assert_send_sync::<StreamPolicy>();
    assert_send_sync::<StreamRule>();
    assert_send_sync::<TrustedKeys>();
    assert_send_sync::<ReceiveReport>();
    assert_send_sync::<ReceiveWarning>();
    assert_send_sync::<ReceiveService>();
    assert_send_sync::<HostEntry>();
    assert_send_sync::<HookRefusal>();
    fn assert_send<T: Send>() {}
    assert_send::<UpdatePlan>();
};