Skip to main content

IntoPadding

Trait IntoPadding 

Source
pub trait IntoPadding<const D: usize> {
    // Required method
    fn into_padding(self) -> [(usize, usize); D];
}
Expand description

Trait for types that can be used as padding specifications.

Padding is specified as (before, after) pairs per dimension, returned as a fixed-size array [(usize, usize); D]. If fewer pairs than dimensions are provided, they apply to the last N dimensions (earlier dimensions are left unpadded).

Required Methods§

Source

fn into_padding(self) -> [(usize, usize); D]

Converts into a fixed-size array of (before, after) padding pairs.

Implementations on Foreign Types§

Source§

impl<const D: usize> IntoPadding<D> for &[(usize, usize)]

Source§

fn into_padding(self) -> [(usize, usize); D]

Source§

impl<const D: usize> IntoPadding<D> for (usize, usize, usize, usize)

Backward-compatible: (left, right, top, bottom) maps to last 2 dimensions.

Equivalent to [(top, bottom), (left, right)].

Source§

fn into_padding(self) -> [(usize, usize); D]

Source§

impl<const D: usize> IntoPadding<D> for Vec<(usize, usize)>

Source§

fn into_padding(self) -> [(usize, usize); D]

Source§

impl<const D: usize, const N: usize> IntoPadding<D> for [(usize, usize); N]

Source§

fn into_padding(self) -> [(usize, usize); D]

Implementors§