pub trait HasHeaderField {
// Required method
fn check_header(&self) -> Result<bool, OtToolsIoError>;
}Expand description
A type has a header field which needs implementations to handle validation
Required Methods§
Sourcefn check_header(&self) -> Result<bool, OtToolsIoError>
fn check_header(&self) -> Result<bool, OtToolsIoError>
Method to verify if header(s) are valid in some data. See this thread.
use ot_tools_io::{HasHeaderField, OctatrackFileIO, BankFile};
assert!(BankFile::from_data_file(&path).unwrap().check_header().unwrap()) // true for valid header values