[][src]Struct aeron_rs::image::Image

pub struct Image { /* fields omitted */ }

Callback for handling fragments of data being read from a log.

@param buffer containing the data. @param offset at which the data begins. @param length of the data in bytes. @param header representing the meta data for the data. @return The action to be taken with regard to the stream position after the callback.

Methods

impl Image[src]

pub fn term_buffer_length(&self) -> i32[src]

Get the length in bytes for each term partition in the log buffer.

@return the length in bytes for each term partition in the log buffer.

pub fn position_bits_to_shift(&self) -> i32[src]

Number of bits to right shift a position to get a term count for how far the stream has progressed.

@return of bits to right shift a position to get a term count for how far the stream has progressed.

pub fn session_id(&self) -> i32[src]

The session_id for the steam of messages.

@return the session_id for the steam of messages.

pub fn correlation_id(&self) -> i64[src]

The correlationId for identification of the image with the media driver.

@return the correlationId for identification of the image with the media driver.

pub fn subscription_registration_id(&self) -> i64[src]

The registrationId for the Subscription of the Image.

@return the registrationId for the Subscription of the Image.

pub fn join_position(&self) -> i64[src]

The position at which this stream was joined.

@return the position at which this stream was joined.

pub fn initial_term_id(&self) -> i32[src]

The initial term at which the stream started for this session.

@return the initial term id.

pub fn source_identity(&self) -> CString[src]

The source identity of the sending publisher as an abstract concept appropriate for the media.

@return source identity of the sending publisher as an abstract concept appropriate for the media.

pub fn is_closed(&self) -> bool[src]

Has this object been closed and should no longer be used?

@return true if it has been closed otherwise false.

pub fn position(&self) -> i64[src]

The position this Image has been consumed to by the subscriber.

@return the position this Image has been consumed to by the subscriber or CLOSED if closed

pub fn subscriber_position_id(&self) -> i32[src]

Get the counter id used to represent the subscriber position.

@return the counter id used to represent the subscriber position.

pub fn set_position(&self, new_position: i64) -> Result<(), AeronError>[src]

Set the subscriber position for this Image to indicate where it has been consumed to.

@param newPosition for the consumption point.

pub fn is_end_of_stream(&self) -> bool[src]

Is the current consumed position at the end of the stream?

@return true if at the end of the stream or false if not.

pub fn poll(
    &mut self,
    fragment_handler: &mut impl FnMut(&AtomicBuffer, Index, Index, &Header),
    fragment_limit: i32
) -> i32
[src]

Poll for new messages in a stream. If new messages are found beyond the last consumed position then they will be delivered via the fragment_handler_t up to a limited number of fragments as specified.

@param fragmentHandler to which messages are delivered. @param fragment_limit for the number of fragments to be consumed during one polling operation. @return the number of fragments that have been consumed.

@see fragment_handler_t

pub fn bounded_poll(
    &mut self,
    fragment_handler: impl FnMut(&AtomicBuffer, Index, Index, &Header),
    limit_position: i64,
    fragment_limit: i32
) -> i32
[src]

Poll for new messages in a stream. If new messages are found beyond the last consumed position then they will be delivered via the fragment_handler_t up to a limited number of fragments as specified or the maximum position specified.

@param fragmentHandler to which messages are delivered. @param limitPosition to consume messages up to. @param fragment_limit for the number of fragments to be consumed during one polling operation. @return the number of fragments that have been consumed.

@see fragment_handler_t

pub fn controlled_poll(
    &mut self,
    fragment_handler: impl FnMut(&AtomicBuffer, Index, Index, &Header) -> Result<ControlledPollAction, AeronError>,
    fragment_limit: i32
) -> i32
[src]

Poll for new messages in a stream. If new messages are found beyond the last consumed position then they will be delivered to the controlled_poll_fragment_handler_t up to a limited number of fragments as specified.

To assemble messages that span multiple fragments then use ControlledFragmentAssembler.

@param fragmentHandler to which message fragments are delivered. @param fragment_limit for the number of fragments to be consumed during one polling operation. @return the number of fragments that have been consumed.

@see controlled_poll_fragment_handler_t

pub fn bounded_controlled_poll(
    &mut self,
    fragment_handler: impl FnMut(&AtomicBuffer, Index, Index, &Header) -> Result<ControlledPollAction, AeronError>,
    max_position: i64,
    fragment_limit: i32
) -> i32
[src]

Poll for new messages in a stream. If new messages are found beyond the last consumed position then they will be delivered to the controlled_poll_fragment_handler_t up to a limited number of fragments as specified or the maximum position specified.

To assemble messages that span multiple fragments then use ControlledFragmentAssembler.

@param fragmentHandler to which message fragments are delivered. @param max_position to consume messages up to. @param fragment_limit for the number of fragments to be consumed during one polling operation. @return the number of fragments that have been consumed. @see controlled_poll_fragment_handler_t

pub fn controlled_peek(
    &mut self,
    initial_position: i64,
    fragment_handler: impl FnMut(&AtomicBuffer, Index, Index, &Header) -> Result<ControlledPollAction, AeronError>,
    limit_position: i64
) -> Result<i64, AeronError>
[src]

Peek for new messages in a stream by scanning forward from an initial position. If new messages are found then they will be delivered to the controlled_poll_fragment_handler_t up to a limited position.

To assemble messages that span multiple fragments then use ControlledFragmentAssembler. Scans must also start at the beginning of a message so that the assembler is reset.

@param initial_position from which to peek forward. @param fragmentHandler to which message fragments are delivered. @param limitPosition up to which can be scanned. @return the resulting position after the scan terminates which is a complete message. @see controlled_poll_fragment_handler_t

pub fn block_poll(
    &self,
    block_handler: BlockHandler,
    block_length_limit: Index
) -> i32
[src]

Poll for new messages in a stream. If new messages are found beyond the last consumed position then they will be delivered via the block_handler_t up to a limited number of bytes.

A scan will terminate if a padding frame is encountered. If first frame in a scan is padding then a block for the padding is notified. If the padding comes after the first frame in a scan then the scan terminates at the offset the padding frame begins. Padding frames are delivered singularly in a block.

Padding frames may be for a greater range than the limit offset but only the header needs to be valid so relevant length of the frame is sizeof DataHeaderDefn.

@param blockHandler to which block is delivered. @param blockLengthLimit up to which a block may be in length. @return the number of bytes that have been consumed.

@see block_handler_t

pub fn log_buffers(&self) -> Arc<LogBuffers>[src]

pub fn close(&mut self)[src]

@cond HIDDEN_SYMBOLS

Trait Implementations

impl Clone for Image[src]

impl Send for Image[src]

impl Sync for Image[src]

Auto Trait Implementations

impl RefUnwindSafe for Image

impl Unpin for Image

impl UnwindSafe for Image

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.