pub trait TryConvert<T, U> {
    type Output;

    // Required method
    fn try_convert(&self) -> Self::Output;
}
Expand description

Convert (fallibly) the type of a geometry’s coordinate value.

§Examples

use geo::{TryConvert, LineString, line_string};

let line_string_64: LineString<i64> = line_string![
    (x: 5, y: 10),
    (x: 3, y: 1),
    (x: 8, y: 9),
];

let line_string_32: Result<LineString<i32>, _> = line_string_64.try_convert();

Required Associated Types§

Required Methods§

source

fn try_convert(&self) -> Self::Output

Implementors§

source§

impl<G, T: CoordNum, U> TryConvert<T, U> for G
where G: MapCoords<T, U>, U: TryFrom<T> + CoordNum,

§

type Output = Result<<G as MapCoords<T, U>>::Output, <U as TryFrom<T>>::Error>