Skip to main content

ChunkGeometry

Struct ChunkGeometry 

Source
pub struct ChunkGeometry { /* private fields */ }
Expand description

Physical payload geometry available to one exchange direction.

Runtime policy chooses how many slots one publication should span. The resulting chunk capacity is always an exact multiple of the physical slot payload size: slots * slot_payload_bytes.

Implementations§

Source§

impl ChunkGeometry

Source

pub const fn new( slot_payload_bytes: usize, slots_per_lane: usize, ) -> Option<Self>

Source

pub const fn slot_payload_bytes(self) -> usize

Usable payload bytes in one physical slot. Slot metadata lives outside this capacity.

Source

pub const fn slots_per_lane(self) -> usize

Maximum slots one publication may reserve from this node’s lane.

Source

pub const fn chunk_bytes(self, slots: usize) -> Option<usize>

Exact publication capacity for a runtime-selected slot count.

Source

pub const fn slots_for_target(self, target_bytes: usize) -> Option<usize>

Convert a byte target into a valid runtime slot count. The target is rounded down to whole slots, but never below one slot, and clamped to the node lane.

Source

pub const fn chunk_bytes_for_target(self, target_bytes: usize) -> Option<usize>

Effective chunk capacity for a runtime byte target. This is always n * slot_payload_bytes for a valid lane-bounded n.

Source

pub const fn plan( self, data_bytes: usize, slots_per_chunk: usize, ) -> Option<ChunkPlan>

Plan a known payload using a runtime-selected slot count.

Source

pub const fn plan_for_target( self, data_bytes: usize, target_bytes: usize, ) -> Option<ChunkPlan>

Plan a known payload from a runtime byte target after aligning it to the physical slot payload geometry.

Trait Implementations§

Source§

impl Clone for ChunkGeometry

Source§

fn clone(&self) -> Self

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 Copy for ChunkGeometry

Source§

impl Debug for ChunkGeometry

Source§

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

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

impl Eq for ChunkGeometry

Source§

impl Hash for ChunkGeometry

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 PartialEq for ChunkGeometry

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ChunkGeometry

Auto Trait Implementations§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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, 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.