concision_core/ops/pad/
padding.rs1use super::{PadAction, PadMode, Padding};
6
7impl<T> Default for Padding<T> {
8 fn default() -> Self {
9 Self::new()
10 }
11}
12
13impl<T> Padding<T> {
14 pub fn new() -> Self {
15 Self {
16 action: PadAction::default(),
17 mode: PadMode::default(),
18 pad: Vec::new(),
19 padding: 0,
20 }
21 }
22
23 pub fn pad(&self) -> &[[usize; 2]] {
24 &self.pad
25 }
26
27 pub fn with_action(mut self, action: PadAction) -> Self {
28 self.action = action;
29 self
30 }
31
32 pub fn with_mode(mut self, mode: PadMode<T>) -> Self {
33 self.mode = mode;
34 self
35 }
36
37 pub fn with_padding(mut self, padding: usize) -> Self {
38 self.padding = padding;
39 self
40 }
41}