SplitRule

Trait SplitRule 

Source
pub trait SplitRule: Neg<Output = Self> {
    // Required method
    fn split_once(self, value: u16) -> (u16, u16);
}
Expand description

Defines how to split a dimension into two parts.

Implemented for i32 (absolute pixel count) and f64 (ratio). Negative values take from the end instead of the beginning.

Required Methods§

Source

fn split_once(self, value: u16) -> (u16, u16)

Splits the given value into two parts according to this rule.

Implementations on Foreign Types§

Source§

impl SplitRule for f64

Source§

fn split_once(self, value: u16) -> (u16, u16)

Source§

impl SplitRule for i32

Source§

fn split_once(self, value: u16) -> (u16, u16)

Implementors§