pub struct Grid {
pub rate: u32,
pub a: i128,
pub d: i128,
}Expand description
Sample n stands at a*n/d samples of rate, in lowest terms, a, d > 0: every grid
starts at t = 0, so a sample index is the one clock every read and key counts in.
Fields§
§rate: u32§a: i128§d: i128Implementations§
Source§impl Grid
impl Grid
pub const fn of(rate: u32) -> Grid
pub fn is_rate(&self) -> bool
Sourcepub fn instant(&self, n: i64) -> f64
pub fn instant(&self, n: i64) -> f64
One quotient: correctly rounded while both integers are under 2^53; past that each integer rounds once converting and the quotient once more.
pub fn stepped(&self, n: i64) -> f64
pub fn position(&self, n: i64) -> f64
pub fn sr(&self) -> f64
pub fn count(&self, t: f64) -> f64
Trait Implementations§
impl Copy for Grid
impl Eq for Grid
Source§impl Ord for Grid
impl Ord for Grid
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Grid
impl PartialOrd for Grid
impl StructuralPartialEq for Grid
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnsafeUnpin for Grid
impl UnwindSafe for Grid
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