pub struct InferredDenominator<N>(/* private fields */);
Expand description
A constructor for DivInt
that infers the denominator.
In Rust 1.79, the following code does not compile (See Rust issue #80528):
ⓘ
use div_int::DivInt;
let r: DivInt<u8, 50> = DivInt::<u8, _>::from_numerator(12);
This struct offers a workaround by using two separate generics for numerator and denominator:
use div_int::{InferredDenominator, DivInt};
let r: DivInt<u8, 50> = InferredDenominator::<u8>::div_int(12);
Implementations§
Source§impl<N> InferredDenominator<N>
impl<N> InferredDenominator<N>
Auto Trait Implementations§
impl<N> Freeze for InferredDenominator<N>
impl<N> RefUnwindSafe for InferredDenominator<N>where
N: RefUnwindSafe,
impl<N> Send for InferredDenominator<N>where
N: Send,
impl<N> Sync for InferredDenominator<N>where
N: Sync,
impl<N> Unpin for InferredDenominator<N>where
N: Unpin,
impl<N> UnwindSafe for InferredDenominator<N>where
N: UnwindSafe,
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