pub struct CanonicalBacktestResult { /* private fields */ }Expand description
Versioned deterministic projection of observable backtest state.
Implementations§
Source§impl CanonicalBacktestResult
impl CanonicalBacktestResult
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self>
pub fn from_slice(bytes: &[u8]) -> Result<Self>
Decodes canonical result bytes and verifies their envelope, normalization, and exact encoding.
Inner records retain their NautilusTrader model serialization and are compared as semantic content. Producers must use the version 1 writer rather than construct records independently.
§Errors
Returns an error if the bytes are not a canonical version 1 result.
Sourcepub fn to_bytes(&self) -> Result<Vec<u8>>
pub fn to_bytes(&self) -> Result<Vec<u8>>
Returns the canonical compact UTF-8 JSON bytes without trailing data.
§Errors
Returns an error if the in-memory document cannot be serialized.
Sourcepub fn digest(&self) -> Result<String>
pub fn digest(&self) -> Result<String>
Returns blake3: followed by the 32-byte BLAKE3 digest as 64 lowercase hex digits.
§Errors
Returns an error if the in-memory document cannot be serialized.
Sourcepub fn first_divergence(
&self,
actual: &Self,
) -> Option<CanonicalResultDivergence>
pub fn first_divergence( &self, actual: &Self, ) -> Option<CanonicalResultDivergence>
Returns the first field-level or record-level difference.
Trait Implementations§
Source§impl Clone for CanonicalBacktestResult
impl Clone for CanonicalBacktestResult
Source§fn clone(&self) -> CanonicalBacktestResult
fn clone(&self) -> CanonicalBacktestResult
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 CanonicalBacktestResult
impl Debug for CanonicalBacktestResult
impl Eq for CanonicalBacktestResult
Source§impl PartialEq for CanonicalBacktestResult
impl PartialEq for CanonicalBacktestResult
impl StructuralPartialEq for CanonicalBacktestResult
Auto Trait Implementations§
impl Freeze for CanonicalBacktestResult
impl RefUnwindSafe for CanonicalBacktestResult
impl Send for CanonicalBacktestResult
impl Sync for CanonicalBacktestResult
impl Unpin for CanonicalBacktestResult
impl UnsafeUnpin for CanonicalBacktestResult
impl UnwindSafe for CanonicalBacktestResult
Blanket Implementations§
impl<T> Allocation for T
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<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.§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
Checks if this value is equivalent to the given key. Read more
§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
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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