pub struct Datatype {
pub complex: bool,
pub scalar: Scalar,
pub big_endian: bool,
}Expand description
A sample format of SigMF: [c|r][f32|f64|i32|i16|i8|u32|u16|u8][_le|_be] (the
8-bit types without endianness).
Integer samples are converted to floating point without scaling; the unsigned types
are centred by $2^{b-1}$ (128 for cu8), as the reference implementation
sigmf-python does. SigMF::full_scale gives the scale of its autoscale.
Fields§
§complex: boolComplex (interleaved I and Q) or real.
scalar: ScalarThe type of a component.
big_endian: boolBig-endian components.
Implementations§
Source§impl Datatype
impl Datatype
Sourcepub fn parse(s: &str) -> Result<Datatype>
pub fn parse(s: &str) -> Result<Datatype>
Parse a SigMF data type (cf32_le, ci16_be, cu8, ri8, …; the endianness
may be omitted, little endian then).
§Errors
Error::Config for an unknown type.
Sourcepub fn sample_bytes(self) -> usize
pub fn sample_bytes(self) -> usize
Bytes per sample (both components for a complex type).
Trait Implementations§
impl Copy for Datatype
impl Eq for Datatype
impl StructuralPartialEq for Datatype
Auto Trait Implementations§
impl Forget for Datatype
impl Freeze for Datatype
impl RefUnwindSafe for Datatype
impl Send for Datatype
impl Sync for Datatype
impl Unpin for Datatype
impl UnsafeUnpin for Datatype
impl UnwindSafe for Datatype
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more