Trait for converting values, matrices, etc. from one `Real` type to another.
| 202 | |
| 203 | /// Trait for converting values, matrices, etc. from one `Real` type to another. |
| 204 | pub trait RealConvert: Sized { |
| 205 | type Out<To> |
| 206 | where |
| 207 | To: Real; |
| 208 | |
| 209 | /// Tries to convert this value to the target type, returns `None` if value cannot be represented by the target type |
| 210 | fn try_convert<To: Real>(self) -> Option<Self::Out<To>>; |
| 211 | /// Converts this value to the target type, panics if value cannot be represented by the target type |
| 212 | #[inline] |
| 213 | fn convert<To: Real>(self) -> Self::Out<To> { |
| 214 | self.try_convert().expect("failed to convert") |
| 215 | } |
| 216 | } |
| 217 | |
| 218 | impl<From: Real> RealConvert for &From { |
| 219 | type Out<To> |
nothing calls this directly
no outgoing calls
no test coverage detected