pub struct AutoPadConfig {
pub mode: PaddingMode,
pub min_pad: usize,
pub max_pad: Option<usize>,
pub power_of_2: bool,
pub center: bool,
}Expand description
Auto-padding configuration
Fields§
§mode: PaddingModePadding mode
min_pad: usizeMinimum padding length (default: 0)
max_pad: Option<usize>Maximum padding length (default: input length)
power_of_2: boolWhether to pad to power of 2
center: boolWhether to center the data in padded array
Implementations§
Source§impl AutoPadConfig
impl AutoPadConfig
Sourcepub fn new(mode: PaddingMode) -> Self
pub fn new(mode: PaddingMode) -> Self
Create a new auto-padding configuration
Sourcepub fn with_min_pad(self, minpad: usize) -> Self
pub fn with_min_pad(self, minpad: usize) -> Self
Set minimum padding
Sourcepub fn with_max_pad(self, maxpad: usize) -> Self
pub fn with_max_pad(self, maxpad: usize) -> Self
Set maximum padding
Sourcepub fn with_power_of_2(self) -> Self
pub fn with_power_of_2(self) -> Self
Require power of 2 size
Sourcepub fn with_center(self) -> Self
pub fn with_center(self) -> Self
Center the data in padded array
Trait Implementations§
Source§impl Clone for AutoPadConfig
impl Clone for AutoPadConfig
Source§fn clone(&self) -> AutoPadConfig
fn clone(&self) -> AutoPadConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AutoPadConfig
impl Debug for AutoPadConfig
Auto Trait Implementations§
impl Freeze for AutoPadConfig
impl RefUnwindSafe for AutoPadConfig
impl Send for AutoPadConfig
impl Sync for AutoPadConfig
impl Unpin for AutoPadConfig
impl UnwindSafe for AutoPadConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more