Skip to main content

GenericBlockSize

Struct GenericBlockSize 

Source
pub struct GenericBlockSize<T: BlockSizeSpec>(/* private fields */);
Expand description

Represents a block size that is a power of 2, parameterized by a BlockSizeSpec.

Provides zero-cost bitwise operations for alignments, conversions, and arithmetic with integers.

Implementations§

Source§

impl<T: BlockSizeSpec> GenericBlockSize<T>

Source

pub fn from_spec(spec: T) -> Self

Source

pub fn get(self) -> u64

Returns the block size in bytes.

Source

pub fn mask(self) -> u64

Returns the alignment mask (size - 1).

Source

pub fn shift(self) -> u32

Returns the power-of-two bit shift (e.g. 12 for 4096-byte blocks).

Source

pub fn is_aligned(self, value: impl IsAligned<T>) -> bool

Returns true if value is aligned to this block size.

Source

pub fn align_up(self, bytes: u64) -> Option<u64>

Aligns bytes up to the nearest block boundary, returning None on overflow.

Source

pub fn align_down(self, bytes: u64) -> u64

Aligns bytes down to the nearest block boundary.

Source

pub fn align_up_to_blocks(self, bytes: u64) -> u64

Aligns bytes up to the nearest block boundary and returns the total number of blocks.

Source

pub fn align_range_outwards( self, range: impl Borrow<Range<u64>>, ) -> Option<Range<u64>>

Aligns the range outwards to block boundaries (start aligned down, end aligned up).

Returns None if aligning end overflows u64.

Source§

impl GenericBlockSize<MaskShiftSpec>

Source

pub const SIZE_512B: Self

Source

pub const SIZE_1KIB: Self

Source

pub const SIZE_2KIB: Self

Source

pub const SIZE_4KIB: Self

Source

pub const SIZE_8KIB: Self

Source

pub const SIZE_16KIB: Self

Source

pub const SIZE_32KIB: Self

Source

pub const SIZE_64KIB: Self

Source

pub const SIZE_128KIB: Self

Source

pub const SIZE_256KIB: Self

Source

pub const SIZE_512KIB: Self

Source

pub const SIZE_1MIB: Self

Source

pub const fn new(block_size: u32) -> Option<Self>

Constructs a BlockSize from a u32 byte count if it is a power of 2 and not equal to 0.

Source

pub const fn from_u64(block_size: u64) -> Option<Self>

Constructs a BlockSize from a u64 if it is a power of 2, not equal to 0, and the mask fits in a u32. This is equivalent to Self::new but allows for constructing a 4GiB block size.

Source

pub const fn size(self) -> u64

Returns the block size in bytes.

Equivalent to Self::get but can be called from a const context.

Trait Implementations§

Source§

impl<T: BlockSizeSpec> Add<&GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: &GenericBlockSize<T>) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<&GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: &GenericBlockSize<T>) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<&u64> for GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: &u64) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<&u64> for &GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: &u64) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: GenericBlockSize<T>) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: GenericBlockSize<T>) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<u64> for GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: u64) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> Add<u64> for &GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the + operator.
Source§

fn add(self, other: u64) -> u64

Performs the + operation. Read more
Source§

impl<T: BlockSizeSpec> AddAssign<&GenericBlockSize<T>> for u64

Source§

fn add_assign(&mut self, other: &GenericBlockSize<T>)

Performs the += operation. Read more
Source§

impl<T: BlockSizeSpec> AddAssign<GenericBlockSize<T>> for u64

Source§

fn add_assign(&mut self, other: GenericBlockSize<T>)

Performs the += operation. Read more
Source§

impl<T: BlockSizeSpec> Binary for GenericBlockSize<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Clone + BlockSizeSpec> Clone for GenericBlockSize<T>

Source§

fn clone(&self) -> GenericBlockSize<T>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Copy + BlockSizeSpec> Copy for GenericBlockSize<T>

Source§

impl<T: Debug + BlockSizeSpec> Debug for GenericBlockSize<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: BlockSizeSpec> Display for GenericBlockSize<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: BlockSizeSpec> Div<&GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the / operator.
Source§

fn div(self, other: &GenericBlockSize<T>) -> u64

Performs the / operation. Read more
Source§

impl<T: BlockSizeSpec> Div<&GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the / operator.
Source§

fn div(self, other: &GenericBlockSize<T>) -> u64

Performs the / operation. Read more
Source§

impl<T: BlockSizeSpec> Div<GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the / operator.
Source§

fn div(self, other: GenericBlockSize<T>) -> u64

Performs the / operation. Read more
Source§

impl<T: BlockSizeSpec> Div<GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the / operator.
Source§

fn div(self, other: GenericBlockSize<T>) -> u64

Performs the / operation. Read more
Source§

impl<T: BlockSizeSpec> DivAssign<&GenericBlockSize<T>> for u64

Source§

fn div_assign(&mut self, other: &GenericBlockSize<T>)

Performs the /= operation. Read more
Source§

impl<T: BlockSizeSpec> DivAssign<GenericBlockSize<T>> for u64

Source§

fn div_assign(&mut self, other: GenericBlockSize<T>)

Performs the /= operation. Read more
Source§

impl<T: Eq + BlockSizeSpec> Eq for GenericBlockSize<T>

Source§

impl From<GenericBlockSize<PageSizeSpec>> for BlockSize

Source§

fn from(_value: GenericBlockSize<PageSizeSpec>) -> Self

Converts to this type from the input type.
Source§

impl<T: BlockSizeSpec> Hash for GenericBlockSize<T>

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T: BlockSizeSpec> LowerHex for GenericBlockSize<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: BlockSizeSpec> Mul<&GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: &GenericBlockSize<T>) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<&GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: &GenericBlockSize<T>) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<&u64> for GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u64) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<&u64> for &GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: &u64) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: GenericBlockSize<T>) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: GenericBlockSize<T>) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<u64> for GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: u64) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> Mul<u64> for &GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the * operator.
Source§

fn mul(self, other: u64) -> u64

Performs the * operation. Read more
Source§

impl<T: BlockSizeSpec> MulAssign<&GenericBlockSize<T>> for u64

Source§

fn mul_assign(&mut self, other: &GenericBlockSize<T>)

Performs the *= operation. Read more
Source§

impl<T: BlockSizeSpec> MulAssign<GenericBlockSize<T>> for u64

Source§

fn mul_assign(&mut self, other: GenericBlockSize<T>)

Performs the *= operation. Read more
Source§

impl<T: BlockSizeSpec> Octal for GenericBlockSize<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: BlockSizeSpec> Ord for GenericBlockSize<T>

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl<T: BlockSizeSpec> PartialEq<&GenericBlockSize<T>> for u64

Source§

fn eq(&self, other: &&GenericBlockSize<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec> PartialEq<&u64> for GenericBlockSize<T>

Source§

fn eq(&self, other: &&u64) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec> PartialEq<GenericBlockSize<T>> for u64

Source§

fn eq(&self, other: &GenericBlockSize<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec> PartialEq<GenericBlockSize<T>> for &u64

Source§

fn eq(&self, other: &GenericBlockSize<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec, U: BlockSizeSpec> PartialEq<GenericBlockSize<T>> for GenericBlockSize<U>

Source§

fn eq(&self, other: &GenericBlockSize<T>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec> PartialEq<u64> for GenericBlockSize<T>

Source§

fn eq(&self, other: &u64) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec> PartialEq<u64> for &GenericBlockSize<T>

Source§

fn eq(&self, other: &u64) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<T: BlockSizeSpec> PartialOrd<&GenericBlockSize<T>> for u64

Source§

fn partial_cmp(&self, other: &&GenericBlockSize<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec> PartialOrd<&u64> for GenericBlockSize<T>

Source§

fn partial_cmp(&self, other: &&u64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec> PartialOrd<GenericBlockSize<T>> for u64

Source§

fn partial_cmp(&self, other: &GenericBlockSize<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec> PartialOrd<GenericBlockSize<T>> for &u64

Source§

fn partial_cmp(&self, other: &GenericBlockSize<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec, U: BlockSizeSpec> PartialOrd<GenericBlockSize<T>> for GenericBlockSize<U>

Source§

fn partial_cmp(&self, other: &GenericBlockSize<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec> PartialOrd<u64> for GenericBlockSize<T>

Source§

fn partial_cmp(&self, other: &u64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec> PartialOrd<u64> for &GenericBlockSize<T>

Source§

fn partial_cmp(&self, other: &u64) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<T: BlockSizeSpec> Rem<&GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the % operator.
Source§

fn rem(self, other: &GenericBlockSize<T>) -> u64

Performs the % operation. Read more
Source§

impl<T: BlockSizeSpec> Rem<&GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the % operator.
Source§

fn rem(self, other: &GenericBlockSize<T>) -> u64

Performs the % operation. Read more
Source§

impl<T: BlockSizeSpec> Rem<GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the % operator.
Source§

fn rem(self, other: GenericBlockSize<T>) -> u64

Performs the % operation. Read more
Source§

impl<T: BlockSizeSpec> Rem<GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the % operator.
Source§

fn rem(self, other: GenericBlockSize<T>) -> u64

Performs the % operation. Read more
Source§

impl<T: BlockSizeSpec> RemAssign<&GenericBlockSize<T>> for u64

Source§

fn rem_assign(&mut self, other: &GenericBlockSize<T>)

Performs the %= operation. Read more
Source§

impl<T: BlockSizeSpec> RemAssign<GenericBlockSize<T>> for u64

Source§

fn rem_assign(&mut self, other: GenericBlockSize<T>)

Performs the %= operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<&GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: &GenericBlockSize<T>) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<&GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: &GenericBlockSize<T>) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<&u64> for GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u64) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<&u64> for &GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: &u64) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<GenericBlockSize<T>> for u64

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: GenericBlockSize<T>) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<GenericBlockSize<T>> for &u64

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: GenericBlockSize<T>) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<u64> for GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: u64) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> Sub<u64> for &GenericBlockSize<T>

Source§

type Output = u64

The resulting type after applying the - operator.
Source§

fn sub(self, other: u64) -> u64

Performs the - operation. Read more
Source§

impl<T: BlockSizeSpec> SubAssign<&GenericBlockSize<T>> for u64

Source§

fn sub_assign(&mut self, other: &GenericBlockSize<T>)

Performs the -= operation. Read more
Source§

impl<T: BlockSizeSpec> SubAssign<GenericBlockSize<T>> for u64

Source§

fn sub_assign(&mut self, other: GenericBlockSize<T>)

Performs the -= operation. Read more
Source§

impl<T: BlockSizeSpec> UpperHex for GenericBlockSize<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for GenericBlockSize<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for GenericBlockSize<T>
where T: RefUnwindSafe,

§

impl<T> Send for GenericBlockSize<T>
where T: Send,

§

impl<T> Sync for GenericBlockSize<T>
where T: Sync,

§

impl<T> Unpin for GenericBlockSize<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for GenericBlockSize<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for GenericBlockSize<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.