pub struct ProfileReport {
pub version: u32,
pub entries: Vec<ProfileEntry>,
}Expand description
A persistable table of every profile measurement the Judge produced in one run.
Fields§
§version: u32§entries: Vec<ProfileEntry>Implementations§
Source§impl ProfileReport
impl ProfileReport
Sourcepub fn save(&self, path: &Path) -> Result<(), Error>
pub fn save(&self, path: &Path) -> Result<(), Error>
Atomic write to path as JSON (sibling .tmp + rename).
Sourcepub fn load(
path: &Path,
current: &[EquivalenceKey],
) -> Result<Option<ProfileReport>, Error>
pub fn load( path: &Path, current: &[EquivalenceKey], ) -> Result<Option<ProfileReport>, Error>
Load a previously-persisted report, validated against the hardware of
the loading machine. current is that machine’s device equivalence
classes (via crate::probe::equivalence_classes); requiring it in the
signature makes it impossible to load without declaring what hardware
you are on — the gate cannot be forgotten by a caller.
Returns:
Ok(None)on a missing file.Ok(None)on a schema-version mismatch that still deserializes (an additive change: the pre-v5 fields#[serde(default)]in, then this version gate rejects the report).Ok(None)on FOREIGN HARDWARE. AProfileReportis the output of ONE Judge run on ONE machine, so if ANY entry’sdeviceidentity is not amongcurrent, the run happened elsewhere and the WHOLE report is refused — the entries that do match are not a valid subset, they are a foreign report with coincidental overlap, and thedevice_indexit was keyed by rebinds across machines.Erron a NON-ADDITIVE schema change that fails to PARSE. Such a change never reaches the version gate above, because deserialization fails first — which is exactly why every new field carries#[serde(default)]. A future “check the version first, it’s cheaper” cleanup MUST preserveOk(None)for a deserializable stale report;v4_report_yields_no_oracle_entriespins that invariant.
All three Ok(None) cases are “cache miss, re-run the Judge” signals.
Trait Implementations§
Source§impl Clone for ProfileReport
impl Clone for ProfileReport
Source§fn clone(&self) -> ProfileReport
fn clone(&self) -> ProfileReport
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 ProfileReport
impl Debug for ProfileReport
Source§impl<'de> Deserialize<'de> for ProfileReport
impl<'de> Deserialize<'de> for ProfileReport
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProfileReport, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProfileReport, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ProfileReport
impl PartialEq for ProfileReport
Source§impl Serialize for ProfileReport
impl Serialize for ProfileReport
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ProfileReport
Auto Trait Implementations§
impl Freeze for ProfileReport
impl RefUnwindSafe for ProfileReport
impl Send for ProfileReport
impl Sync for ProfileReport
impl Unpin for ProfileReport
impl UnsafeUnpin for ProfileReport
impl UnwindSafe for ProfileReport
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<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more