Weave documentation
Rust referenceloom-git

loom-git · export

Source declarations, signatures and documentation for export.

Source: sigil/weave/tools/loom-git/src/export.rs. SHA-256: b2b94bac1d8345baf5dd85de218b9f3d9c6bdcbfa248d7a21bdbdfd81e7c739d.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

export::ExportPlan

What the CLI shim hands the exporter.

#[derive(Debug, Clone)]
pub struct ExportPlan {
/// Loom commits in topo order (parents-first, same shape as

/// [`crate::ImportPlan::commits`]). Each commit's `parents` field is a

/// list of indices into this vector.

pub commits: Vec<ExportCommit>,
/// Branch name to set in the destination git repo (typically `main`).

pub branch: String
}

Source line: 37.

export::ExportCommit

One commit ready for export. The shim populates this from a loom Commit plus the bytes of every blob it references.

#[derive(Debug, Clone)]
pub struct ExportCommit {
pub commit: Commit,
/// Indices into [`ExportPlan::commits`] of this commit's parents.

pub parents: Vec<usize>,
/// Resolved blob payloads keyed by `manifest.blob` (blake3 hex). The

/// shim is responsible for reading these from the loom blobs Locus.

pub blob_bytes: std::collections::HashMap<String, Vec<u8>>
}

Source line: 49.

export::ExportReport

What was written.

#[derive(Debug, Clone, Copy)]
pub struct ExportReport {
pub commits_exported: usize,
pub trees_written: usize,
pub blobs_written: usize
}

Source line: 60.

export::export_to_git

Write a fresh bare git repo at dest containing the history described by plan. The directory is initialized if it doesn't exist, otherwise it must be empty (we don't merge into existing histories yet).

pub fn export_to_git(dest: &std::path::Path, plan: &ExportPlan) -> crate::Result<ExportReport>;

Source line: 69.

On this page