[][src]Struct aeron_rs::subscription::Subscription

pub struct Subscription { /* fields omitted */ }

Methods

impl Subscription[src]

pub fn new(
    conductor: Arc<Mutex<ClientConductor>>,
    registration_id: i64,
    channel: CString,
    stream_id: i32,
    channel_status_id: i32
) -> Self
[src]

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

Media address for delivery to the channel.

@return Media address for delivery to the channel.

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

Stream identity for scoping within the channel media address.

@return Stream identity for scoping within the channel media address.

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

Registration Id returned by Aeron::addSubscription when this Subscription was added.

@return the registrationId of the subscription.

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

Get the counter id used to represent the channel status.

@return the counter id used to represent the channel status.

pub fn add_destination(
    &self,
    endpoint_channel: String
) -> Result<i64, AeronError>
[src]

pub fn remove_destination(
    &self,
    endpoint_channel: String
) -> Result<i64, AeronError>
[src]

pub fn find_destination_response(
    &self,
    correlation_id: i64
) -> Result<bool, AeronError>
[src]

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

pub fn poll_end_of_streams(&self, end_of_stream_handler: fn(_: &Image)) -> i32[src]

Poll the Image s under the subscription for having reached End of Stream.

@param end_of_stream_handler callback for handling end of stream indication. @return number of Image s that have reached End of Stream. @deprecated

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

Poll the {@link Image}s under the subscription for available message fragments.

Each fragment read will be a whole message if it is under MTU length. If larger than MTU then it will come as a series of fragments ordered withing a session.

@param fragment_handler callback for handling each message fragment as it is read. @param fragment_limit number of message fragments to limit for the poll across multiple Image s. @return the number of fragments received

@see fragment_handler_t

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

Poll in a controlled manner the Image s under the subscription for available message fragments. Control is applied to fragments in the stream. If more fragments can be read on another stream they will even if BREAK or ABORT is returned from the fragment handler.

Each fragment read will be a whole message if it is under MTU length. If larger than MTU then it will come as a series of fragments ordered within a session.

To assemble messages that span multiple fragments then use controlled_poll_fragment_handler_t.

@param fragment_handler callback for handling each message fragment as it is read. @param fragment_limit number of message fragments to limit for the poll operation across multiple Image s. @return the number of fragments received @see controlled_poll_fragment_handler_t

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

Poll the Image s under the subscription for available message fragments in blocks.

@param block_handler to receive a block of fragments from each Image. @param block_length_limit for each individual block. @return the number of bytes consumed.

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

Is the subscription connected by having at least one open image available.

@return true if the subscription has more than one open image available.

pub fn image_count(&self) -> usize[src]

Count of images associated with this subscription.

@return count of images associated with this subscription.

pub fn image_by_session_id(&self, session_id: i32) -> Option<&Image>[src]

Return the {@link Image} associated with the given session_id.

This method generates a new copy of the Image overlaying the logbuffer. It is up to the application to not use the Image if it becomes unavailable.

@param session_id associated with the Image. @return Image associated with the given session_id or nullptr if no Image exist.

pub fn image_by_index(&mut self, index: usize) -> Option<&mut Image>[src]

Get the image at the given index from the images array.

This is only valid until the image list changes.

@param index in the array @return image at given index or exception if out of range.

pub fn images(&self) -> &Vec<Image>[src]

Get a std::vector of active {@link Image}s that match this subscription.

@return a std::vector of active {@link Image}s that match this subscription.

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 has_image(&self, correlation_id: i64) -> bool[src]

pub fn add_image(&mut self, image: Image) -> Vec<Image>[src]

Adds image to the subscription and returns Images as they were just before adding this Image

pub fn remove_image(
    &mut self,
    correlation_id: i64
) -> Option<(Vec<Image>, Index)>
[src]

Removes image with given correlation_id and returns old Images (as of before removal) and index of removed element. Returns None if Image was not removed (e.g. was not found).

pub fn close_and_remove_images(&mut self) -> Option<Vec<Image>>[src]

Removes all images and returns old Images if subscription is not closed. Returns None if subscription is closed.

Trait Implementations

impl Drop for Subscription[src]

Auto Trait Implementations

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.