Struct BufferClaim

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

Represents a claimed range in a buffer to be used for recording a message without copy semantics for later commit.

The claimed space is in {@link #buffer()} between {@link #offset()} and {@link #offset()} + {@link #length()}. When the buffer is filled with message data, use {@link #commit()} to make it available to subscribers.

Implementations§

Source§

impl BufferClaim

Source

pub fn wrap(&mut self, buffer: *mut u8, length: Index)

Source

pub fn wrap_with_offset( &mut self, buffer: &AtomicBuffer, offset: Index, length: Index, )

Source

pub fn buffer(&self) -> AtomicBuffer

The buffer to be used.

@return the buffer to be used..

Source

pub const fn offset(&self) -> Index

The offset in the buffer at which the claimed range begins.

@return offset in the buffer at which the range begins.

Source

pub fn length(&self) -> Index

The length of the claimed range in the buffer.

@return length of the range in the buffer.

Source

pub fn flags(&self) -> u8

Get the value of the flags field.

@return the value of the header flags field.

Source

pub fn set_flags(&mut self, flags: u8) -> &Self

Set the value of the header flags field.

@param flags value to be set in the header. @return this for a fluent API.

Source

pub fn header_type(&self) -> u16

Get the value of the header type field.

@return the value of the header type field.

Source

pub fn set_header_type(&mut self, header_type: u16) -> &Self

Set the value of the header type field.

@param type value to be set in the header. @return this for a fluent API.

Source

pub fn reserved_value(&self) -> i64

Get the value stored in the reserve space at the end of a data frame header.

@return the value stored in the reserve space at the end of a data frame header.

Source

pub fn set_reserved_value(&mut self, value: i64) -> &Self

Write the provided value into the reserved space at the end of the data frame header.

@param value to be stored in the reserve space at the end of a data frame header. @return this for fluent API semantics.

Source

pub fn commit(&mut self)

Commit the message to the log buffer so that is it available to subscribers.

Source

pub fn abort(&mut self)

Abort a claim of the message space to the log buffer so that log can progress ignoring this claim.

Trait Implementations§

Source§

impl Clone for BufferClaim

Source§

fn clone(&self) -> BufferClaim

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for BufferClaim

Source§

fn default() -> BufferClaim

Returns the “default value” for a type. Read more
Source§

impl Copy for BufferClaim

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V