Skip to main content

AeronHeader

Struct AeronHeader 

Source
pub struct AeronHeader { /* private fields */ }

Implementations§

Source§

impl AeronHeader

Source

pub fn new_zeroed_on_heap() -> Self

creates zeroed struct where the underlying c struct is on the heap

Source

pub fn new_zeroed_on_stack() -> Self

creates zeroed struct where the underlying c struct is on the stack (Use with care)

Source

pub fn values(&self, values: &AeronHeaderValues) -> Result<i32, AeronCError>

Get all of the field values from the header. This will do a memcpy into the supplied header_values_t pointer.

§Parameters
  • header to read values from.
  • values to copy values to, must not be null.
§Return

0 on success, -1 on failure.

Source

pub fn get_values(&self) -> Result<AeronHeaderValues, AeronCError>

Get all of the field values from the header. This will do a memcpy into the supplied header_values_t pointer.

Source

pub fn position(&self) -> i64

Get the current position to which the Image has advanced on reading this message.

§Return

the current position to which the Image has advanced on reading this message.

Source

pub fn position_bits_to_shift(&self) -> usize

Get the number of times to left shift the term count to multiply by term length.

§Return

number of times to left shift the term count to multiply by term length.

Source

pub fn next_term_offset(&self) -> i32

Calculates the offset of the frame immediately after this one.

§Return

the offset of the next frame.

Source

pub fn context(&self) -> *mut c_void

Get a pointer to the context associated with this message. Only valid during poll handling. Is normally a pointer to an Image instance.

§Return

a pointer to the context associated with this message.

Source

pub fn get_inner(&self) -> *mut aeron_header_t

Source

pub unsafe fn get_inner_mut(&self) -> &mut aeron_header_t

Mutable access to the underlying C struct, minted from &self: nothing prevents two live &mut at once, so the caller must ensure exclusive access for the lifetime of the returned reference.

§Safety

No other reference (& or &mut) to the underlying struct may be alive while the returned &mut is in use.

Source

pub fn get_inner_ref(&self) -> &aeron_header_t

Source§

impl AeronHeader

Source

pub unsafe fn from_ptr(ptr: *mut aeron_header_t) -> Self

Wraps a pointer to a struct Aeron passes to a callback, without copying it

§Safety

ptr must point at a valid struct for as long as the result is used. For a callback argument that is until the callback returns

Source

pub unsafe fn clone_reference(&self) -> Self

Returns a second handle to the same underlying struct, without copying it. If owned on heap both handles share it; if borrowed, e.g. a callback argument, both point at the same C memory

§Safety

A callback argument lives in memory Aeron frees or reuses when the callback returns, so do not use the returned handle after that. Copy out the fields you need instead

Source§

impl AeronHeader

Source

pub fn image(&self) -> Option<AeronImage>

returns AeronImage, must be called in poll method

Source

pub fn session_id(&self) -> Option<i32>

Session id of this fragment, or None if Aeron could not read the header.

Source

pub fn stream_id(&self) -> Option<i32>

Stream id of this fragment, or None if Aeron could not read the header.

Source

pub fn reserved_value(&self) -> Option<i64>

Reserved value of this fragment, or None if Aeron could not read the header. A sender can stamp a timestamp here (see AeronClaim::set_reserved_value) so the receiver can measure end-to-end latency.

Source

pub fn term_id(&self) -> Option<i32>

Term id of this fragment, or None if Aeron could not read the header.

Source

pub fn term_offset(&self) -> Option<i32>

Term offset of this fragment, or None if Aeron could not read the header.

Trait Implementations§

Source§

impl Debug for AeronHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for AeronHeader

Source§

type Target = aeron_header_stct

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl From<&AeronHeader> for *mut aeron_header_t

Source§

fn from(value: &AeronHeader) -> Self

Converts to this type from the input type.
Source§

impl From<AeronHeader> for *mut aeron_header_t

Source§

fn from(value: AeronHeader) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.