Skip to main content

EDFHeader

Struct EDFHeader 

Source
pub struct EDFHeader { /* private fields */ }

Implementations§

Source§

impl EDFHeader

Source

pub fn new() -> Self

Source

pub fn with_version(&mut self, version: String) -> &mut Self

Source

pub fn with_patient_id(&mut self, patient_id: PatientId) -> &mut Self

Source

pub fn with_recording_id(&mut self, recording_id: RecordingId) -> &mut Self

Source

pub fn with_start_date(&mut self, start_date: NaiveDate) -> &mut Self

Source

pub fn with_start_time(&mut self, start_time: NaiveTime) -> &mut Self

Source

pub fn with_specification( &mut self, specification: EDFSpecifications, ) -> &mut Self

Source

pub fn with_is_continuous(&mut self, is_continuous: bool) -> &mut Self

Source

pub fn with_record_count(&mut self, record_count: usize) -> &mut Self

Source

pub fn with_record_duration(&mut self, record_duration: f64) -> &mut Self

Source

pub fn get_version(&self) -> &String

Source

pub fn get_patient_id(&self) -> &PatientId

Source

pub fn get_recording_id(&self) -> &RecordingId

Source

pub fn get_start_date(&self) -> NaiveDate

Source

pub fn get_start_time(&self) -> NaiveTime

Source

pub fn get_header_bytes(&self) -> usize

Source

pub fn get_specification(&self) -> EDFSpecifications

Source

pub fn is_continuous(&self) -> bool

Source

pub fn get_record_count(&self) -> Option<usize>

Source

pub fn get_record_duration(&self) -> f64

Source

pub fn get_signals(&self) -> &Vec<SignalHeader>

Source

pub fn calculate_header_bytes(&self) -> usize

Source

pub fn data_record_bytes(&self) -> usize

Source

pub fn get_signal_sample_frequency(&self, signal_index: usize) -> Option<f64>

Source

pub fn create_record(&self) -> Record

Source

pub fn serialize(&self) -> Result<String, EDFError>

Source

pub fn deserialize<R: BufRead + Seek>(reader: &mut R) -> Result<Self, EDFError>

Source

pub fn get_sha256(&self) -> Result<String, EDFError>

Serializes the header of the EDF file and calculates a SHA256 hash and returns the result

Source

pub fn is_recording(&self) -> bool

Source

pub fn start_date(&self) -> NaiveDate

Returns the start date of the recording by returning the start date specified in recording_id or if it is not specified, using the old start-date value. Note that the old start date only supports the year range 1985 - 2084, a year outside this range will return the year 2100. This means if the start date is not specified within the recording_id, you might get an invalid date.

Source

pub fn parse_old_start_date(date: &str) -> Result<NaiveDate, EDFError>

Returns the parsed old style date with clipping year 1985. When the year is later than 2084, the expected input year is the string ‘yy’ and this will return the NativeDate with year 2100. Input format has to be dd.mm.yy

Source

pub fn serialize_old_start_date(date: &NaiveDate) -> String

Returns the serialized old style date with clipping year 1985. When the year is later than 2084, the expected output year is the string ‘yy’. The output format will be dd.mm.yy

Trait Implementations§

Source§

impl Clone for EDFHeader

Source§

fn clone(&self) -> EDFHeader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EDFHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EDFHeader

Source§

fn default() -> EDFHeader

Returns the “default value” for a type. Read more
Source§

impl PartialEq for EDFHeader

Source§

fn eq(&self, other: &EDFHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EDFHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.