Struct rust_stdf::stdf_file::StdfReader
source · [−]pub struct StdfReader {
pub file_path: String,
/* private fields */
}Expand description
STDF Reader
This reader can process STDF datalogs of Version V4 and V4-2007
Supported compression:
- Uncompressed
- Gzip (.gz)
Example
use rust_stdf::{stdf_file::*, stdf_record_type::*, StdfRecord};
let stdf_path = "demo_file.stdf";
let mut reader = match StdfReader::new(&stdf_path) {
Ok(r) => r,
Err(e) => {
println!("{}", e);
return;
}
};
// we will count total DUT# in the file
// and put test result of PTR named
// "continuity test" in a vector.
let mut dut_count: u64 = 0;
let mut continuity_rlt = vec![];
// use type filter to work on certain types,
// use `|` to combine multiple typs
let rec_types = REC_PIR | REC_PTR;
// iterator starts from current file position,
// if file hits EOF, it will NOT redirect to 0.
for rec in reader
.get_record_iter()
.filter(|x| x.is_type(rec_types))
{
match rec {
StdfRecord::PIR(_) => {dut_count += 1;}
StdfRecord::PTR(ref ptr_rec) => {
if ptr_rec.test_txt == "continuity test" {
continuity_rlt.push(ptr_rec.result);
}
}
_ => {}
}
}
println!("Total duts {} \n continuity result {:?}",
dut_count,
continuity_rlt);Fields
file_path: StringImplementations
sourceimpl StdfReader
impl StdfReader
pub fn new(path: &str) -> Result<Self, StdfError>
pub fn get_record_iter(&mut self) -> RecordIter<'_>ⓘNotable traits for RecordIter<'_>impl Iterator for RecordIter<'_> type Item = StdfRecord;
Auto Trait Implementations
impl !RefUnwindSafe for StdfReader
impl Send for StdfReader
impl Sync for StdfReader
impl Unpin for StdfReader
impl !UnwindSafe for StdfReader
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more