pub struct FragmentAssembler { /* private fields */ }Expand description
Assembles fragments keyed by fragment_id until all parts arrive.
Implementations§
Source§impl FragmentAssembler
impl FragmentAssembler
pub fn new() -> FragmentAssembler
Sourcepub fn push(
&mut self,
shard: FragmentShard,
) -> Result<Option<Vec<u8>>, FragmentError>
pub fn push( &mut self, shard: FragmentShard, ) -> Result<Option<Vec<u8>>, FragmentError>
Push a new fragment; returns Some(full_payload) when completed.
pub fn inflight(&self) -> usize
Sourcepub fn enforce_retention(&mut self, retention: FragmentRetention)
pub fn enforce_retention(&mut self, retention: FragmentRetention)
Apply retention: evict oldest if exceeding max inflight.
Trait Implementations§
Source§impl Debug for FragmentAssembler
impl Debug for FragmentAssembler
Source§impl Default for FragmentAssembler
impl Default for FragmentAssembler
Source§fn default() -> FragmentAssembler
fn default() -> FragmentAssembler
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for FragmentAssembler
impl RefUnwindSafe for FragmentAssembler
impl Send for FragmentAssembler
impl Sync for FragmentAssembler
impl Unpin for FragmentAssembler
impl UnsafeUnpin for FragmentAssembler
impl UnwindSafe for FragmentAssembler
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