[−][src]Trait piet::conv::RoundFrom
This is our own implementation of a "lossy From" trait, representing a conversion that can have precision loss. It is essentially adapted from https://github.com/rust-lang/rfcs/pull/2484.
If and when such a trait is standardized, we should switch to that. Alternatively, a case can be made it should move somewhere else, or we should adopt a similar trait (it has some similarity to AsPrimitive from num_traits).
Required methods
fn round_from(x: T) -> Self
Implementations on Foreign Types
impl RoundFrom<(f32, f32)> for Vec2
[src]
fn round_from(p: (f32, f32)) -> Vec2
[src]
impl RoundFrom<(f64, f64)> for Vec2
[src]
fn round_from(p: (f64, f64)) -> Vec2
[src]
Implementors
impl RoundFrom<Vec2> for (f32, f32)
[src]
fn round_from(p: Vec2) -> (f32, f32)
[src]
impl RoundFrom<Vec2> for (f64, f64)
[src]
fn round_from(p: Vec2) -> (f64, f64)
[src]
impl RoundFrom<f32> for f64
[src]
fn round_from(x: f32) -> f64
[src]
impl RoundFrom<f64> for f32
[src]
fn round_from(x: f64) -> f32
[src]
impl<T> RoundFrom<T> for T
[src]
Blanket implementation, no conversion needed.