pub struct ModulationIndex {
pub num: u32,
pub den: u32,
}Expand description
A rational modulation index $h = p/q$ (CpmConfig::h_num, CpmConfig::h_den),
read from the fraction "p/q".
§Examples
use comnum_waveform::cpm::ModulationIndex;
let h: ModulationIndex = " 1 / 2".parse()?;
assert_eq!((h.num, h.den), (1, 2));Fields§
§num: u32The numerator $p$.
den: u32The denominator $q$.
Trait Implementations§
Source§impl Clone for ModulationIndex
impl Clone for ModulationIndex
impl Copy for ModulationIndex
Source§impl Debug for ModulationIndex
impl Debug for ModulationIndex
impl Eq for ModulationIndex
Source§impl FromStr for ModulationIndex
impl FromStr for ModulationIndex
Source§fn from_str(s: &str) -> Result<ModulationIndex>
fn from_str(s: &str) -> Result<ModulationIndex>
"p/q", two non-negative integers (spaces around them are ignored); the values
are checked by CpmConfig::build.
§Errors
Error::Config for another text.
Source§impl PartialEq for ModulationIndex
impl PartialEq for ModulationIndex
impl StructuralPartialEq for ModulationIndex
Auto Trait Implementations§
impl Freeze for ModulationIndex
impl RefUnwindSafe for ModulationIndex
impl Send for ModulationIndex
impl Sync for ModulationIndex
impl Unpin for ModulationIndex
impl UnsafeUnpin for ModulationIndex
impl UnwindSafe for ModulationIndex
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