pub trait ToSize2D<T> {
    fn to_size(self) -> Size2D<T>;
}
Expand description

A trait to aid in the ergonomics of creating a Size2D and usage of interfaces expecting Size2D.

Examples

let size = size!(200, 400);

// We can pass another Size2D to this function
size.grow(size!(800, 400));

// But we can also pass a tuple
size.grow((400, 200));

Required Methods

Creates a new Size2D from self

Examples
let size = (200, 100).to_size();

assert_eq!(size, size!(200, 100));

Implementations on Foreign Types

Implementors