Skip to main content

AeronClaim

Struct AeronClaim 

Source
pub struct AeronClaim { /* private fields */ }
Expand description

Zero-copy claim on a publication’s term buffer with a RAII commit-or-abort lifecycle.

A AeronClaim that is dropped without being explicitly committed or aborted is aborted in Drop, releasing the term-buffer slot immediately instead of waiting for AERON_PUBLICATION_UNBLOCK_TIMEOUT_NS (default 15s). AeronClaim::commit / AeronClaim::abort consume self, encoding Aeron’s one-shot claim contract in the type system.

Construct via AeronPublication::try_claim_owned or AeronExclusivePublication::try_claim_owned; the claim is returned only on a successful try_claim, so its inner buffer is always a genuinely claimed slot (never a null zero-default).

Implementations§

Source§

impl AeronClaim

Source

pub fn data(&mut self) -> &mut [u8]

The writable claimed slice (zero-copy into the publication term buffer).

Source

pub fn len(&self) -> usize

Length of the claimed slice in bytes.

Source

pub fn is_empty(&self) -> bool

Whether the claimed slice is empty.

Source

pub fn position(&self) -> i64

Stream position Aeron assigned to this claim.

Source

pub fn commit(self) -> Result<i64, AeronCError>

Commit the claimed bytes, publishing them to subscribers. Consumes self.

Source

pub fn abort(self) -> Result<(), AeronCError>

Abort the claim, discarding the slot as padding for subscribers. Consumes self.

Trait Implementations§

Source§

impl Drop for AeronClaim

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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<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.