pub struct PackVerdict {
pub measured: bool,
pub reason: Option<String>,
pub dir: String,
pub profile: Option<String>,
pub commit: Option<String>,
pub files: usize,
pub sources: usize,
pub largest_tokens: u64,
pub findings: Vec<PackFinding>,
pub passes: bool,
}Expand description
The verdict on a written pack: whether it could be read, what its manifest names, how many files and sources it holds, and every finding against it.
The examples below build a pack of a repository holding main.rs.
use majordomus_cli::pack::{build, plan, verify, PackVerdict, Profiles};
let profiles = Profiles::load(&share, &root).unwrap();
let out = dir.path().join("pack");
let v: PackVerdict = build(&plan(&root, &share, None), &root, &out).unwrap();
assert_eq!((v.files, v.sources), (2, 1), "the index and one shard, carrying one file");
assert_eq!(v.profile.as_deref(), Some("chat"));
// a directory with no manifest is not measured, which is not a pass
let v: PackVerdict = verify(dir.path(), &profiles, &root);
assert!(!v.measured && !v.passes);Fields§
§measured: boolWhether the pack could be read at all. false is not a pass.
reason: Option<String>Why it could not, when it could not.
dir: StringThe directory read.
profile: Option<String>The profile its manifest names.
commit: Option<String>The commit its manifest names.
files: usizeHow many files it holds, the index included.
sources: usizeHow many source files its shards carry.
largest_tokens: u64The tokens of its largest file.
findings: Vec<PackFinding>Every finding. Empty is the passing answer.
passes: booltrue when the pack was read and nothing was found.
Trait Implementations§
Source§impl Clone for PackVerdict
impl Clone for PackVerdict
Source§fn clone(&self) -> PackVerdict
fn clone(&self) -> PackVerdict
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackVerdict
impl Debug for PackVerdict
Source§impl<'de> Deserialize<'de> for PackVerdict
impl<'de> Deserialize<'de> for PackVerdict
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PackVerdict
Source§impl JsonSchema for PackVerdict
impl JsonSchema for PackVerdict
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for PackVerdict
impl PartialEq for PackVerdict
Source§fn eq(&self, other: &PackVerdict) -> bool
fn eq(&self, other: &PackVerdict) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PackVerdict
impl Serialize for PackVerdict
impl StructuralPartialEq for PackVerdict
Auto Trait Implementations§
impl Freeze for PackVerdict
impl RefUnwindSafe for PackVerdict
impl Send for PackVerdict
impl Sync for PackVerdict
impl Unpin for PackVerdict
impl UnsafeUnpin for PackVerdict
impl UnwindSafe for PackVerdict
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.