Skip to main content

Resize

Trait Resize 

Source
pub trait Resize: Sized {
    type Output;

    // Required methods
    fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output;
    fn try_resize(self, at_least_bits_precision: u32) -> Option<Self::Output>;

    // Provided method
    fn resize(self, at_least_bits_precision: u32) -> Self::Output { ... }
}
Expand description

Methods for resizing the allocated storage.

Required Associated Types§

Source

type Output

The result of the resizing.

Required Methods§

Source

fn resize_unchecked(self, at_least_bits_precision: u32) -> Self::Output

Resizes to the minimum storage that fits at_least_bits_precision without checking if the bit size of self is larger than at_least_bits_precision.

Variable-time w.r.t. at_least_bits_precision.

Source

fn try_resize(self, at_least_bits_precision: u32) -> Option<Self::Output>

Resizes to the minimum storage that fits at_least_bits_precision returning None if the bit size of self is larger than at_least_bits_precision.

Variable-time w.r.t. at_least_bits_precision.

Provided Methods§

Source

fn resize(self, at_least_bits_precision: u32) -> Self::Output

Resizes to the minimum storage that fits at_least_bits_precision panicking if the bit size of self is larger than at_least_bits_precision.

Variable-time w.r.t. at_least_bits_precision.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Resize for &BoxedUint

Available on crate feature alloc only.
Source§

impl Resize for &NonZero<BoxedUint>

Available on crate feature alloc only.
Source§

impl Resize for &OddBoxedUint

Available on crate feature alloc only.
Source§

impl Resize for BoxedUint

Available on crate feature alloc only.
Source§

impl Resize for NonZero<BoxedUint>

Available on crate feature alloc only.
Source§

impl Resize for OddBoxedUint

Available on crate feature alloc only.