[][src]Struct aeron_rs::fragment_assembler::FragmentAssembler

pub struct FragmentAssembler<'a> { /* fields omitted */ }

A handler that sits in a chain-of-responsibility pattern that reassembles fragmented messages so that the next handler in the chain only sees whole messages.

Unfragmented messages are delegated without copy. Fragmented messages are copied to a temporary buffer for reassembly before delegation.

The Header passed to the delegate on assembling a message will be that of the last fragment.

Session based buffers will be allocated and grown as necessary based on the length of messages to be assembled. When sessions go inactive see {@link on_unavailable_image_t}, it is possible to free the buffer by calling {@link #deleteSessionBuffer(std::int32_t)}.

Methods

impl<'a> FragmentAssembler<'a>[src]

pub fn new(
    delegate: &'a mut impl Fragment,
    initial_buffer_length: Option<isize>
) -> Self
[src]

Construct an adapter to reassembly message fragments and delegate on only whole messages.

@param delegate onto which whole messages are forwarded. @param initialBufferLength to be used for each session.

pub fn handler(&'a mut self) -> impl Fragment + 'a[src]

Compose a fragment_handler_t that calls the this FragmentAssembler instance for reassembly. Suitable for passing to Subscription::poll(fragment_handler_t, int).

@return fragment_handler_t composed with the FragmentAssembler instance

pub fn delete_session_buffer(&mut self, session_id: i32)[src]

Free an existing session buffer to reduce memory pressure when an Image goes inactive or no more large messages are expected.

@param sessionId to have its buffer freed

Auto Trait Implementations

impl<'a> !RefUnwindSafe for FragmentAssembler<'a>

impl<'a> !Send for FragmentAssembler<'a>

impl<'a> !Sync for FragmentAssembler<'a>

impl<'a> Unpin for FragmentAssembler<'a>

impl<'a> !UnwindSafe for FragmentAssembler<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.