Struct mseed::PackInfo

source ·
pub struct PackInfo {
    pub sample_rate: c_double,
    pub format_version: c_uchar,
    pub pub_version: c_uchar,
    pub flags: MSBitFieldFlags,
    pub encoding: MSDataEncoding,
    pub rec_len: c_int,
    pub extra_headers: Option<CString>,
    /* private fields */
}
Expand description

Struct providing miniSEED record packing information.

Fields§

§sample_rate: c_double

Record sample rate.

§format_version: c_uchar

The miniSEED format version.

§pub_version: c_uchar

Publication version.

§flags: MSBitFieldFlags

Bit field flags.

§encoding: MSDataEncoding

Data encoding.

§rec_len: c_int

Record length used for encoding.

§extra_headers: Option<CString>

Extra headers.

If not None it is expected to contain extra headers, i.e. a string containing (compact) JSON, that will be added to each output record.

Implementations§

source§

impl PackInfo

source

pub fn new<T>(sid: T) -> MSResult<Self>
where T: Into<Vec<u8>>,

Creates a new PackInfo from a FDSN source identifier.

source

pub fn with_sample_rate<T>(sid: T, sample_rate: c_double) -> MSResult<Self>
where T: Into<Vec<u8>>,

Creates a new PackInfo from a FDSN source identifier with configured sample rate.

Note that by libmseed convention a negative sample_rate value is considered as a sample rate period (i.e. in units of seconds (s)), while a positive sample rate value is considered as a sample rate frequency (i.e. in units of Hertz (Hz)).

See also factor_multiplier_to_sample_rate.

source

pub fn sid(&self) -> &CString

Returns a reference to the FDSN source identifier.

source

pub fn set_sid<T>(&mut self, sid: T) -> MSResult<()>
where T: Into<Vec<u8>>,

Trait Implementations§

source§

impl Clone for PackInfo

source§

fn clone(&self) -> PackInfo

Returns a copy 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 PackInfo

source§

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

Formats the value using the given formatter. Read more

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> 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> ToOwned for T
where T: Clone,

§

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>,

§

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>,

§

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.