Skip to main content

AeronDriver

Struct AeronDriver 

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

Implementations§

Source§

impl AeronDriver

Source

pub fn new(context: &AeronDriverContext) -> Result<Self, AeronCError>

Create a AeronDriver struct and initialize from the AeronDriverContext struct.

The given AeronDriverContext struct will be used exclusively by the driver. Do not reuse between drivers.

§Parameters
  • context to use for initialization.
§Return

0 for success and -1 for error.

Source

pub fn context(&self) -> Ref<'_, AeronDriverContext>

Source

pub fn conductor(&self) -> AeronDriverConductor

Source

pub fn native_resource_agent(&self) -> AeronDriverNativeResourceAgent

Source

pub fn sender(&self) -> AeronDriverSender

Source

pub fn receiver(&self) -> AeronDriverReceiver

Source

pub fn runners(&self) -> [aeron_agent_runner_t; 4]

Source

pub fn subscribable_is_active_state( state: aeron_subscription_tether_state_t, ) -> bool

Source

pub fn start(&self, manual_main_loop: bool) -> Result<i32, AeronCError>

Start an AeronDriver given the threading mode. This may spawn threads for the Sender, Receiver, and Conductor depending on threading mode used.

§Parameters
  • manual_main_loop to be called by the caller for the Conductor do_work cycle.
§Return

0 for success and -1 for error.

Source

pub fn main_do_work(&self) -> Result<i32, AeronCError>

Call the Conductor (or Shared) main do_work duty cycle once.

Driver must have been created with manual_main_loop set to true.

§Return

0 for success and -1 for error.

Source

pub fn main_idle_strategy(&self, work_count: c_int)

Call the Conductor (or Shared) Idle Strategy.

§Parameters
  • work_count to pass to idle strategy.
Source

pub fn uri_get_offset_info(offset: i32) -> &'static str

SAFETY: this is static for performance reasons, so you should not store this without copying it!!

Source

pub fn threading_mode_to_string(mode: aeron_threading_mode_t) -> &'static str

SAFETY: this is static for performance reasons, so you should not store this without copying it!!

Source

pub fn version_text() -> &'static str

SAFETY: this is static for performance reasons, so you should not store this without copying it!!

Source

pub fn version_git_sha() -> &'static str

SAFETY: this is static for performance reasons, so you should not store this without copying it!!

Source

pub fn version_major() -> Result<i32, AeronCError>

Source

pub fn version_minor() -> Result<i32, AeronCError>

Source

pub fn version_patch() -> Result<i32, AeronCError>

Source

pub fn termination_validator_default_allow( state: *mut c_void, token_buffer: &mut [u8], ) -> bool

Source

pub fn termination_validator_default_deny( state: *mut c_void, token_buffer: &mut [u8], ) -> bool

Source

pub fn termination_validator_load( validator_name: &CStr, ) -> aeron_driver_termination_validator_func_t

Source

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

Source

pub unsafe fn get_inner_mut(&self) -> &mut aeron_driver_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_driver_t

Source§

impl AeronDriver

Source

pub fn launch_embedded( aeron_context: AeronDriverContext, register_sigint: bool, ) -> (Arc<AtomicBool>, JoinHandle<Result<(), AeronCError>>)

Source

pub fn launch_embedded_guard( aeron_context: AeronDriverContext, register_sigint: bool, ) -> EmbeddedMediaDriver

Launch an embedded media driver, returning a RAII guard that stops the driver on drop (so a panic or early return can’t leak a driver process).

Prefer this over Self::launch_embedded, which returns a raw (Arc<AtomicBool>, JoinHandle) tuple the caller must remember to drive. register_sigint is true to mirror the standalone binary.

Source

pub fn wait_for_previous_media_driver_to_timeout( aeron_context: &AeronDriverContext, )

If existing shm files are still within the driver timeout, a new driver tries to reuse them and fails. This waits in that case and otherwise proceeds

Trait Implementations§

Source§

impl Clone for AeronDriver

Source§

fn clone(&self) -> AeronDriver

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for AeronDriver

Source§

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

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

impl Deref for AeronDriver

Source§

type Target = aeron_driver_stct

The resulting type after dereferencing.
Source§

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

Dereferences the value.
Source§

impl From<&AeronDriver> for *mut aeron_driver_t

Source§

fn from(value: &AeronDriver) -> Self

Converts to this type from the input type.
Source§

impl From<*const aeron_driver_stct> for AeronDriver

Source§

fn from(value: *const aeron_driver_t) -> Self

Converts to this type from the input type.
Source§

impl From<*mut aeron_driver_stct> for AeronDriver

Source§

fn from(value: *mut aeron_driver_t) -> Self

Converts to this type from the input type.
Source§

impl From<AeronDriver> for *mut aeron_driver_t

Source§

fn from(value: AeronDriver) -> Self

Converts to this type from the input type.
Source§

impl From<AeronDriver> for aeron_driver_t

Source§

fn from(value: AeronDriver) -> Self

Converts to this type from the input type.
Source§

impl From<aeron_driver_stct> for AeronDriver

Source§

fn from(value: aeron_driver_t) -> Self

Converts to this type from the input type.
Source§

impl Send for AeronDriver

Source§

impl Sync for AeronDriver

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