pub struct TraceReader { /* private fields */ }Expand description
A trace read back from its archive. Steps and metadata are read when it opens; blobs, sources and real timings are read on demand.
Implementations§
Source§impl TraceReader
impl TraceReader
Sourcepub fn open(path: &Path) -> Result<Self, TraceError>
pub fn open(path: &Path) -> Result<Self, TraceError>
Opens the trace at path.
Sourcepub fn from_bytes(bytes: Vec<u8>) -> Result<Self, TraceError>
pub fn from_bytes(bytes: Vec<u8>) -> Result<Self, TraceError>
Reads a trace held in memory.
Sourcepub fn written_by(&self) -> &str
pub fn written_by(&self) -> &str
The icedwright version that wrote the trace.
Sourcepub fn frames_dropped(&self) -> u32
pub fn frames_dropped(&self) -> u32
How many frames the writer dropped to fit the size cap.
Sourcepub fn tree(&self, blob: &BlobRef<Yaml>) -> Result<String, TraceError>
pub fn tree(&self, blob: &BlobRef<Yaml>) -> Result<String, TraceError>
The tree’s YAML as stored; parse it with icedwright-semantics’ yaml::read.
Sourcepub fn real_timings(&self) -> Result<RealTimings, TraceError>
pub fn real_timings(&self) -> Result<RealTimings, TraceError>
The real-clock timings, which comparisons skip.
Sourcepub fn source(&self, file: &str) -> Result<Option<String>, TraceError>
pub fn source(&self, file: &str) -> Result<Option<String>, TraceError>
The text of a source file a step’s location names, if the trace holds it.
Sourcepub fn attachments(&self) -> Vec<String>
pub fn attachments(&self) -> Vec<String>
The names of the files the test attached, in archive order, which is by name.
Sourcepub fn attachment(&self, name: &str) -> Result<Option<Vec<u8>>, TraceError>
pub fn attachment(&self, name: &str) -> Result<Option<Vec<u8>>, TraceError>
An attached file’s bytes, if the trace holds it.
Trait Implementations§
Source§impl Clone for TraceReader
impl Clone for TraceReader
Auto Trait Implementations§
impl Forget for TraceReader
impl Freeze for TraceReaderwhere
*const ArcInner<[u8]> is !null: Freeze,
PhantomData<ArcInner<[u8]>>: Freeze,
*const ArcInner<ZipArchiveMetadata> is !null: Freeze,
PhantomData<ArcInner<ZipArchiveMetadata>>: Freeze,
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<WindowMeta>: Freeze,
PhantomData<Step>: Freeze,
impl Move for TraceReader
impl RefUnwindSafe for TraceReader
impl Send for TraceReader
impl Sync for TraceReader
impl Unpin for TraceReader
impl UnsafeUnpin for TraceReaderwhere
*const ArcInner<[u8]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[u8]>>: UnsafeUnpin,
*const ArcInner<ZipArchiveMetadata> is !null: UnsafeUnpin,
PhantomData<ArcInner<ZipArchiveMetadata>>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<WindowMeta>: UnsafeUnpin,
PhantomData<Step>: UnsafeUnpin,
impl UnwindSafe for TraceReaderwhere
Arc<[u8]>: UnwindSafe,
Arc<ZipArchiveMetadata>: UnwindSafe,
RawVecInner: UnwindSafe,
&'static str: UnwindSafe,
String: UnwindSafe,
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