pub struct PackPlan {Show 16 fields
pub measured: bool,
pub reason: Option<String>,
pub profile: String,
pub commit: Option<String>,
pub index_matches_head: bool,
pub tracked: usize,
pub selected: usize,
pub bytes: u64,
pub tokens: u64,
pub tokenizer: String,
pub limits: Option<ShardLimits>,
pub dropped: BTreeMap<String, usize>,
pub dropped_files: Vec<DroppedFile>,
pub shards: Vec<ShardPlan>,
pub findings: Vec<PackFinding>,
pub passes: bool,
}Expand description
The plan of one pack: what it carries, what it leaves out and why, how it is cut into shards, and whether it may be built.
The examples below plan a repository holding main.rs and a logo.png whose content is
binary, with a distribution whose chat profile has limits and whose bare one has none.
use majordomus_cli::pack::{plan, PackPlan};
let p: PackPlan = plan(&root, &share, None).plan;
assert!(p.measured && p.passes && p.index_matches_head);
assert_eq!((p.tracked, p.selected), (2, 1));
assert_eq!(p.dropped["binary"], 1);
// an unknown profile is not measured, and not measured is never a pass
let p: PackPlan = plan(&root, &share, Some("nope")).plan;
assert!(!p.measured && !p.passes);Fields§
§measured: boolWhether the tree could be read at all. false is not a pass.
reason: Option<String>Why it could not, when it could not.
profile: StringThe profile planned.
commit: Option<String>The commit HEAD names; the content is the index’s, which equals it when
index_matches_head is true.
index_matches_head: boolWhether the index holds exactly what HEAD holds. false means staged changes
travel with the pack under a commit id that does not contain them.
tracked: usizeHow many files the index tracks.
selected: usizeHow many the pack carries.
bytes: u64The bytes of the content carried.
tokens: u64The tokens of the content carried, in o200k_base.
tokenizer: StringThe tokenizer the counts are in.
limits: Option<ShardLimits>The limits applied.
dropped: BTreeMap<String, usize>How many files were left out, by reason.
dropped_files: Vec<DroppedFile>Every file left out for a reason other than derived.
shards: Vec<ShardPlan>The shards, in order; the index is not one of them.
findings: Vec<PackFinding>Every reason the pack cannot be built. Empty is the passing answer.
passes: booltrue when the tree was measured and nothing was found.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PackPlan
impl<'de> Deserialize<'de> for PackPlan
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for PackPlan
Source§impl JsonSchema for PackPlan
impl JsonSchema for PackPlan
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreimpl StructuralPartialEq for PackPlan
Auto Trait Implementations§
impl Freeze for PackPlan
impl RefUnwindSafe for PackPlan
impl Send for PackPlan
impl Sync for PackPlan
impl Unpin for PackPlan
impl UnsafeUnpin for PackPlan
impl UnwindSafe for PackPlan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.