pub struct FragmentAssembler<T> { /* private fields */ }Expand description
A fragment assembler that owns its callback.
Polling and changing callback state require an exclusive borrow. No reference count, mutex or runtime callback borrow check is needed while polling. The callback may borrow local state. This assembler stays on its thread and cannot be cloned. It allocates a buffer per fragmented session and grows it for larger messages
Use Self::handler and Self::handler_mut to access callback state
between calls to Self::poll. Use AeronImageFragmentAssembler when polling one image
Implementations§
Source§impl<T: AeronFragmentHandlerCallback> FragmentAssembler<T>
impl<T: AeronFragmentHandlerCallback> FragmentAssembler<T>
pub fn new(handler: T) -> Result<Self, AeronCError>
Sourcepub fn handler_mut(&mut self) -> &mut T
pub fn handler_mut(&mut self) -> &mut T
Change callback state between polls.
Sourcepub fn poll<S: ResourceStorage<aeron_subscription_t>>(
&mut self,
source: &AeronSubscription<S>,
fragment_limit: usize,
) -> Result<i32, AeronCError>
pub fn poll<S: ResourceStorage<aeron_subscription_t>>( &mut self, source: &AeronSubscription<S>, fragment_limit: usize, ) -> Result<i32, AeronCError>
Poll and call the handler with complete messages.
Source§impl<T> FragmentAssembler<T>
impl<T> FragmentAssembler<T>
Sourcepub fn delete_session_buffer(&mut self, session_id: i32) -> bool
pub fn delete_session_buffer(&mut self, session_id: i32) -> bool
Release the partial message buffer for a session, if one exists.
Trait Implementations§
Source§impl<T: AeronFragmentHandlerCallback> AeronFragmentHandlerCallback for FragmentAssembler<T>
impl<T: AeronFragmentHandlerCallback> AeronFragmentHandlerCallback for FragmentAssembler<T>
fn handle_aeron_fragment_handler(&mut self, buffer: &[u8], header: &AeronHeader)
Source§impl<T> Drop for FragmentAssembler<T>
impl<T> Drop for FragmentAssembler<T>
Auto Trait Implementations§
impl<T> !Send for FragmentAssembler<T>
impl<T> !Sync for FragmentAssembler<T>
impl<T> Freeze for FragmentAssembler<T>
impl<T> RefUnwindSafe for FragmentAssembler<T>where
T: RefUnwindSafe,
impl<T> Unpin for FragmentAssembler<T>
impl<T> UnsafeUnpin for FragmentAssembler<T>
impl<T> UnwindSafe for FragmentAssembler<T>where
T: UnwindSafe,
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