pub struct StaticMapBuilder { /* private fields */ }
Expand description

Builder for StaticMap.

Implementations§

source§

impl StaticMapBuilder

source

pub fn new() -> Self

Create a new builder with defaults.

Examples found in repository?
examples/empty_map.rs (line 4)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/circle.rs (line 7)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(5)
        .build()?;

    let circle_outline = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 255, 255, 255, 255))
        .radius(9.)
        .build()?;

    let circle = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 0, 0, 255, 255))
        .radius(6.)
        .build()?;

    map.add_tool(circle_outline);
    map.add_tool(circle);

    map.save_png("circle.png")?;

    Ok(())
}
examples/icon.rs (line 4)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
examples/line.rs (line 7)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(400)
        .padding((10, 0))
        .build()
        .unwrap();

    let lat: &[f64] = &[52.5, 48.9];
    let lon: Vec<f64> = vec![13.4, 2.3];

    let red = Color::new(true, 255, 0, 0, 255);
    let white = Color::new(true, 255, 255, 255, 255);

    let line = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon.clone())
        .width(3.)
        .simplify(true)
        .color(red)
        .build()?;

    let underline = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon)
        .width(5.)
        .simplify(true)
        .color(white)
        .build()?;

    map.add_tool(underline);
    map.add_tool(line);

    map.save_png("line.png")?;

    Ok(())
}
source

pub fn width(self, width: u32) -> Self

Image width, in pixels. Default is 300.

Examples found in repository?
examples/empty_map.rs (line 5)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/circle.rs (line 8)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(5)
        .build()?;

    let circle_outline = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 255, 255, 255, 255))
        .radius(9.)
        .build()?;

    let circle = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 0, 0, 255, 255))
        .radius(6.)
        .build()?;

    map.add_tool(circle_outline);
    map.add_tool(circle);

    map.save_png("circle.png")?;

    Ok(())
}
examples/icon.rs (line 5)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
examples/line.rs (line 8)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(400)
        .padding((10, 0))
        .build()
        .unwrap();

    let lat: &[f64] = &[52.5, 48.9];
    let lon: Vec<f64> = vec![13.4, 2.3];

    let red = Color::new(true, 255, 0, 0, 255);
    let white = Color::new(true, 255, 255, 255, 255);

    let line = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon.clone())
        .width(3.)
        .simplify(true)
        .color(red)
        .build()?;

    let underline = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon)
        .width(5.)
        .simplify(true)
        .color(white)
        .build()?;

    map.add_tool(underline);
    map.add_tool(line);

    map.save_png("line.png")?;

    Ok(())
}
source

pub fn height(self, height: u32) -> Self

Image height, in pixels. Default is 300.

Examples found in repository?
examples/empty_map.rs (line 6)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/circle.rs (line 9)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(5)
        .build()?;

    let circle_outline = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 255, 255, 255, 255))
        .radius(9.)
        .build()?;

    let circle = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 0, 0, 255, 255))
        .radius(6.)
        .build()?;

    map.add_tool(circle_outline);
    map.add_tool(circle);

    map.save_png("circle.png")?;

    Ok(())
}
examples/icon.rs (line 6)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
examples/line.rs (line 9)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(400)
        .padding((10, 0))
        .build()
        .unwrap();

    let lat: &[f64] = &[52.5, 48.9];
    let lon: Vec<f64> = vec![13.4, 2.3];

    let red = Color::new(true, 255, 0, 0, 255);
    let white = Color::new(true, 255, 255, 255, 255);

    let line = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon.clone())
        .width(3.)
        .simplify(true)
        .color(red)
        .build()?;

    let underline = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon)
        .width(5.)
        .simplify(true)
        .color(white)
        .build()?;

    map.add_tool(underline);
    map.add_tool(line);

    map.save_png("line.png")?;

    Ok(())
}
source

pub fn padding(self, padding: (u32, u32)) -> Self

Padding between map features and edge of map in x and y direction. Default is (0, 0).

Examples found in repository?
examples/icon.rs (line 7)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/line.rs (line 10)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(400)
        .padding((10, 0))
        .build()
        .unwrap();

    let lat: &[f64] = &[52.5, 48.9];
    let lon: Vec<f64> = vec![13.4, 2.3];

    let red = Color::new(true, 255, 0, 0, 255);
    let white = Color::new(true, 255, 255, 255, 255);

    let line = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon.clone())
        .width(3.)
        .simplify(true)
        .color(red)
        .build()?;

    let underline = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon)
        .width(5.)
        .simplify(true)
        .color(white)
        .build()?;

    map.add_tool(underline);
    map.add_tool(line);

    map.save_png("line.png")?;

    Ok(())
}
source

pub fn zoom(self, zoom: u8) -> Self

Map zoom, usually between 1-17. Determined based on map features if not specified.

Examples found in repository?
examples/empty_map.rs (line 7)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/circle.rs (line 11)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(5)
        .build()?;

    let circle_outline = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 255, 255, 255, 255))
        .radius(9.)
        .build()?;

    let circle = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 0, 0, 255, 255))
        .radius(6.)
        .build()?;

    map.add_tool(circle_outline);
    map.add_tool(circle);

    map.save_png("circle.png")?;

    Ok(())
}
examples/icon.rs (line 9)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
source

pub fn lat_center(self, coordinate: f64) -> Self

Latitude center of the map. Determined based on map features if not specified.

Examples found in repository?
examples/empty_map.rs (line 9)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
source

pub fn lon_center(self, coordinate: f64) -> Self

Longitude center of the map. Determined based on map features if not specified.

Examples found in repository?
examples/empty_map.rs (line 8)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
source

pub fn url_template<I: Into<String>>(self, url_template: I) -> Self

URL template, e.g. “https://example.com/{z}/{x}/{y}.png”. Default is “https://a.tile.osm.org/{z}/{x}/{y}.png”.

Examples found in repository?
examples/circle.rs (line 10)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(5)
        .build()?;

    let circle_outline = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 255, 255, 255, 255))
        .radius(9.)
        .build()?;

    let circle = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 0, 0, 255, 255))
        .radius(6.)
        .build()?;

    map.add_tool(circle_outline);
    map.add_tool(circle);

    map.save_png("circle.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/icon.rs (line 8)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
source

pub fn tile_size(self, tile_size: u32) -> Self

Tile size, in pixels. Default is 256.

source

pub fn build(self) -> Result<StaticMap, Error>

Consumes the builder.

Examples found in repository?
examples/empty_map.rs (line 10)
3
4
5
6
7
8
9
10
11
12
13
14
15
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(300)
        .zoom(4)
        .lon_center(4.)
        .lat_center(54.)
        .build()?;

    map.save_png("empty_map.png")?;

    Ok(())
}
More examples
Hide additional examples
examples/circle.rs (line 12)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(5)
        .build()?;

    let circle_outline = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 255, 255, 255, 255))
        .radius(9.)
        .build()?;

    let circle = CircleBuilder::new()
        .lon_coordinate(10.)
        .lat_coordinate(47.)
        .color(Color::new(true, 0, 0, 255, 255))
        .radius(6.)
        .build()?;

    map.add_tool(circle_outline);
    map.add_tool(circle);

    map.save_png("circle.png")?;

    Ok(())
}
examples/icon.rs (line 10)
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(200)
        .height(200)
        .padding((80, 0))
        .url_template("https://a.tile.osm.org/{z}/{x}/{y}.png")
        .zoom(12)
        .build()?;

    let icon_flag = IconBuilder::new()
        .lon_coordinate(6.63204)
        .lat_coordinate(45.85378)
        .x_offset(12.)
        .y_offset(32.)
        .path("examples/icons/icon-flag.png")?
        .build()?;

    let icon_factory = IconBuilder::new()
        .lon_coordinate(6.6015)
        .lat_coordinate(45.8485)
        .x_offset(18.)
        .y_offset(18.)
        .path("examples/icons/icon-factory.png")?
        .build()?;

    map.add_tool(icon_flag);
    map.add_tool(icon_factory);

    map.save_png("icon.png")?;

    Ok(())
}
examples/line.rs (line 11)
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
fn main() -> Result<(), Error> {
    let mut map = StaticMapBuilder::new()
        .width(300)
        .height(400)
        .padding((10, 0))
        .build()
        .unwrap();

    let lat: &[f64] = &[52.5, 48.9];
    let lon: Vec<f64> = vec![13.4, 2.3];

    let red = Color::new(true, 255, 0, 0, 255);
    let white = Color::new(true, 255, 255, 255, 255);

    let line = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon.clone())
        .width(3.)
        .simplify(true)
        .color(red)
        .build()?;

    let underline = LineBuilder::new()
        .lat_coordinates(lat.into_iter().copied())
        .lon_coordinates(lon)
        .width(5.)
        .simplify(true)
        .color(white)
        .build()?;

    map.add_tool(underline);
    map.add_tool(line);

    map.save_png("line.png")?;

    Ok(())
}

Trait Implementations§

source§

impl Default for StaticMapBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.