Struct rusteron_media_driver::Aeron

source ·
pub struct Aeron { /* private fields */ }

Implementations§

source§

impl Aeron

source

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

Create a Aeron client struct and initialize from the AeronContext struct.

The given AeronContext struct will be used exclusively by the client. Do not reuse between clients.

§Parameters
  • context to use for initialization.
§Return

0 for success and -1 for error.

source

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

Start an Aeron. This may spawn a thread for the Client Conductor.

§Return

0 for success and -1 for error.

source

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

Call the Conductor main do_work duty cycle once.

Client must have been created with use conductor invoker 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 Idle Strategy.

§Parameters
  • work_count to pass to idle strategy.
source

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

Close and delete Aeron struct.

§Return

0 for success and -1 for error.

source

pub fn is_closed(&self) -> bool

Determines if the client has been closed, e.g. via a driver timeout. Don’t call this method after calling aeron_close as that will have already freed the associated memory.

§Return

true if it has been closed, false otherwise.

source

pub fn print_counters( &self, stream_out: Option<unsafe extern "C" fn(arg1: *const c_char)>, )

Call stream_out to print the counter labels and values.

§Parameters
  • stream_out to call for each label and value.
source

pub fn context(&self) -> AeronContext

Return the AeronContext that is in use by the given client.

§Return

the AeronContext for the given client or NULL for an error.

source

pub fn client_id(&self) -> i64

Return the client id in use by the client.

§Return

id value or -1 for an error.

source

pub fn next_correlation_id(&self) -> i64

Return a unique correlation id from the driver.

§Return

unique correlation id or -1 for an error.

source

pub fn counters_reader(&self) -> AeronCountersReader

Return a reference to the counters reader of the given client.

The AeronCountersReader is maintained by the client. And should not be freed.

§Return

AeronCountersReader or NULL for error.

source

pub fn add_available_counter_handler( &self, pair: &AeronAvailableCounterPair, ) -> Result<i32, AeronCError>

Add a handler to be called when a new counter becomes available.

NOTE: This function blocks until the handler is added by the client conductor thread.

§Parameters
  • pair holding the handler to call and a clientd to pass when called.
§Return

0 for success and -1 for error

source

pub fn remove_available_counter_handler( &self, pair: &AeronAvailableCounterPair, ) -> Result<i32, AeronCError>

Remove a previously added handler to be called when a new counter becomes available.

NOTE: This function blocks until the handler is removed by the client conductor thread.

§Parameters
  • pair holding the handler to call and a clientd to pass when called.
§Return

0 for success and -1 for error

source

pub fn add_unavailable_counter_handler( &self, pair: &AeronUnavailableCounterPair, ) -> Result<i32, AeronCError>

Add a handler to be called when a new counter becomes unavailable or goes away.

NOTE: This function blocks until the handler is added by the client conductor thread.

§Parameters
  • pair holding the handler to call and a clientd to pass when called.
§Return

0 for success and -1 for error

source

pub fn remove_unavailable_counter_handler( &self, pair: &AeronUnavailableCounterPair, ) -> Result<i32, AeronCError>

Remove a previously added handler to be called when a new counter becomes unavailable or goes away.

NOTE: This function blocks until the handler is removed by the client conductor thread.

§Parameters
  • pair holding the handler to call and a clientd to pass when called.
§Return

0 for success and -1 for error

source

pub fn add_close_handler( &self, pair: &AeronCloseClientPair, ) -> Result<i32, AeronCError>

Add a handler to be called when client is closed.

NOTE: This function blocks until the handler is added by the client conductor thread.

§Parameters
  • pair holding the handler to call and a clientd to pass when called.
§Return

0 for success and -1 for error

source

pub fn remove_close_handler( &self, pair: &AeronCloseClientPair, ) -> Result<i32, AeronCError>

Remove a previously added handler to be called when client is closed.

NOTE: This function blocks until the handler is removed by the client conductor thread.

§Parameters
  • pair holding the handler to call and a clientd to pass when called.
§Return

0 for success and -1 for error

source

pub fn version_full(&self) -> &str

Return full version and build string.

§Return

full version and build string.

source

pub fn version_text(&self) -> &str

Return version text.

§Return

version text.

source

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

Return major version number.

§Return

major version number.

source

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

Return minor version number.

§Return

minor version number.

source

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

Return patch version number.

§Return

patch version number.

source

pub fn version_gitsha(&self) -> &str

Return the git sha for the current build.

§Return

git version

source

pub fn nano_clock() -> i64

Return time in nanoseconds for machine. Is not wall clock time.

§Return

nanoseconds since epoch for machine.

source

pub fn epoch_clock() -> i64

Return time in milliseconds since epoch. Is wall clock time.

§Return

milliseconds since epoch.

source

pub fn is_driver_active( dirname: &str, timeout_ms: i64, log_func: aeron_log_func_t, ) -> bool

Determine if an aeron driver is using a given aeron directory.

§Parameters
  • dirname for aeron directory

  • timeout_ms to use to determine activity for aeron directory

  • log_func to call during activity check to log diagnostic information.

§Return

true for active driver or false for no active driver.

source

pub fn properties_buffer_load(buffer: &str) -> Result<i32, AeronCError>

Load properties from a string containing name=value pairs and set appropriate environment variables for the process so that subsequent calls to aeron_driver_context_init will use those values.

§Parameters
  • buffer containing properties and values.
§Return

0 for success and -1 for error.

source

pub fn properties_file_load(filename: &str) -> Result<i32, AeronCError>

Load properties file and set appropriate environment variables for the process so that subsequent calls to aeron_driver_context_init will use those values.

§Parameters
  • filename to load.
§Return

0 for success and -1 for error.

source

pub fn properties_http_load(url: &str) -> Result<i32, AeronCError>

Load properties from HTTP URL and set environment variables for the process so that subsequent calls to aeron_driver_context_init will use those values.

§Parameters
  • url to attempt to retrieve and load.
§Return

0 for success and -1 for error.

source

pub fn properties_load(url_or_filename: &str) -> Result<i32, AeronCError>

Load properties based on URL or filename. If string contains file or http URL, it will attempt to load properties from a file or http as indicated. If not a URL, then it will try to load the string as a filename.

§Parameters
  • url_or_filename to load properties from.
§Return

0 for success and -1 for error.

source

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

Return current aeron error code (errno) for calling thread.

§Return

aeron error code for calling thread.

source

pub fn errmsg(&self) -> &str

Return the current aeron error message for calling thread.

§Return

aeron error message for calling thread.

source

pub fn default_path( path: *mut c_char, path_length: usize, ) -> Result<i32, AeronCError>

Get the default path used by the Aeron media driver.

§Parameters
  • path buffer to store the path.

  • path_length space available in the buffer

§Return

-1 if there is an issue or the number of bytes written to path excluding the terminator \0. If this is equal to or greater than the path_length then the path has been truncated.

source

pub fn randomised_int32() -> i32

source

pub fn thread_set_name(role_name: &str)

source

pub fn nano_sleep(nanoseconds: u64)

source

pub fn micro_sleep(microseconds: c_uint)

source

pub fn thread_set_affinity( role_name: &str, cpu_affinity_no: u8, ) -> Result<i32, AeronCError>

source

pub fn error_log_exists(buffer: *const u8, buffer_size: usize) -> bool

source

pub fn error_log_read<AeronErrorLogReaderFuncHandlerImpl: AeronErrorLogReaderFuncCallback>( buffer: *const u8, buffer_size: usize, reader: Option<&Handler<AeronErrorLogReaderFuncHandlerImpl>>, since_timestamp: i64, ) -> usize

source

pub fn semantic_version_compose(major: u8, minor: u8, patch: u8) -> i32

source

pub fn semantic_version_major(version: i32) -> u8

source

pub fn semantic_version_minor(version: i32) -> u8

source

pub fn semantic_version_patch(version: i32) -> u8

source

pub fn udp_uri_parse( uri: *mut c_char, params: &AeronUdpChannelParams, ) -> Result<i32, AeronCError>

source

pub fn ipc_uri_parse( uri: *mut c_char, params: &AeronIpcChannelParams, ) -> Result<i32, AeronCError>

source

pub fn delete_directory(dirname: &str) -> Result<i32, AeronCError>

Delete the given aeron directory.

§Parameters
  • dirname to delete.
§Return

0 for success and -1 for error.

source

pub fn set_thread_affinity_on_start(state: *mut c_void, role_name: &str)

Affinity setting function that complies with the aeron_agent_on_start_func_t structure that can be used as an agent start function. The state should be the AeronDriverContext* and the function will match the values “conductor”, “sender”, “receiver” and use the respective configuration options from the AeronDriverContext.

§Parameters
  • state client information passed to function, should be the AeronDriverContext*.

  • role_name name of the role specified on the agent.

source

pub fn set_socket_non_blocking(fd: aeron_socket_t) -> Result<i32, AeronCError>

source

pub fn socket(domain: c_int, type_: c_int, protocol: c_int) -> aeron_socket_t

source

pub fn close_socket(socket: aeron_socket_t)

source

pub fn connect( fd: aeron_socket_t, address: &Sockaddr, address_length: socklen_t, ) -> Result<i32, AeronCError>

source

pub fn bind( fd: aeron_socket_t, address: &Sockaddr, address_length: socklen_t, ) -> Result<i32, AeronCError>

source

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

source

pub fn getsockopt( fd: aeron_socket_t, level: c_int, optname: c_int, optval: *mut c_void, optlen: *mut socklen_t, ) -> Result<i32, AeronCError>

source

pub fn setsockopt( fd: aeron_socket_t, level: c_int, optname: c_int, optval: *const c_void, optlen: socklen_t, ) -> Result<i32, AeronCError>

source

pub fn sendmsg(fd: aeron_socket_t, msghdr: &Msghdr, flags: c_int) -> isize

source

pub fn send( fd: aeron_socket_t, buf: *const c_void, len: usize, flags: c_int, ) -> isize

source

pub fn recvmsg(fd: aeron_socket_t, msghdr: &Msghdr, flags: c_int) -> isize

source

pub fn res_header_entry_length( res: *mut c_void, remaining: usize, ) -> Result<i32, AeronCError>

source

pub fn logbuffer_check_term_length(term_length: u64) -> Result<i32, AeronCError>

source

pub fn logbuffer_check_page_size(page_size: u64) -> Result<i32, AeronCError>

source

pub fn is_directory(path: &str) -> Result<i32, AeronCError>

source

pub fn mkdir_recursive( pathname: &str, permission: c_int, ) -> Result<i32, AeronCError>

source

pub fn msync(addr: *mut c_void, length: usize) -> Result<i32, AeronCError>

source

pub fn file_length(path: &str) -> i64

source

pub fn usable_fs_space(path: &str) -> u64

source

pub fn usable_fs_space_disabled(path: &str) -> u64

source

pub fn ipc_publication_location( dst: *mut c_char, length: usize, aeron_dir: &str, correlation_id: i64, ) -> Result<i32, AeronCError>

source

pub fn temp_filename(filename: *mut c_char, length: usize) -> usize

source

pub fn file_resolve( parent: &str, child: &str, buffer: *mut c_char, buffer_len: usize, ) -> Result<i32, AeronCError>

source

pub fn flow_control_parse_tagged_options( options_length: usize, options: &str, flow_control_options: &AeronFlowControlTaggedOptions, ) -> Result<i32, AeronCError>

source

pub fn flow_control_calculate_retransmission_length( resend_length: usize, term_buffer_length: usize, term_offset: usize, retransmit_receiver_window_multiple: usize, ) -> usize

source

pub fn agent_on_start_load(name: &str) -> aeron_agent_on_start_func_t

source

pub fn set_errno(errcode: c_int)

source

pub fn err_set( errcode: c_int, function: &str, filename: &str, line_number: c_int, format: &str, )

source

pub fn err_append( function: &str, filename: &str, line_number: c_int, format: &str, )

source

pub fn err_clear()

source

pub fn parse_port_range( range_str: &str, low_port: &mut u16, high_port: &mut u16, ) -> Result<i32, AeronCError>

source

pub fn config_parse_inferable_boolean( inferable_boolean: &str, def: aeron_inferable_boolean_t, ) -> aeron_inferable_boolean_t

source

pub fn format_date(str_: *mut c_char, count: usize, timestamp: i64)

source

pub fn format_number_to_locale( value: c_longlong, buffer: *mut c_char, buffer_len: usize, ) -> *mut c_char

source

pub fn format_to_hex( str_: *mut c_char, str_length: usize, data: *const u8, data_len: usize, )

source

pub fn ip_addr_resolver( host: &str, sockaddr: &SockaddrStorage, family_hint: c_int, protocol: c_int, ) -> Result<i32, AeronCError>

source

pub fn udp_port_resolver( port_str: &str, optional: bool, ) -> Result<i32, AeronCError>

source

pub fn try_parse_ipv4(host: &str, sockaddr: &SockaddrStorage) -> bool

source

pub fn ipv4_addr_resolver( host: &str, protocol: c_int, sockaddr: &SockaddrStorage, ) -> Result<i32, AeronCError>

source

pub fn try_parse_ipv6(host: &str, sockaddr: &SockaddrStorage) -> bool

source

pub fn ipv6_addr_resolver( host: &str, protocol: c_int, sockaddr: &SockaddrStorage, ) -> Result<i32, AeronCError>

source

pub fn lookup_interfaces<AeronIfaddrFuncHandlerImpl: AeronIfaddrFuncCallback>( func: Option<&Handler<AeronIfaddrFuncHandlerImpl>>, ) -> Result<i32, AeronCError>

source

pub fn lookup_interfaces_from_ifaddrs<AeronIfaddrFuncHandlerImpl: AeronIfaddrFuncCallback>( func: Option<&Handler<AeronIfaddrFuncHandlerImpl>>, ifaddrs: &Ifaddrs, ) -> Result<i32, AeronCError>

source

pub fn set_getifaddrs( get_func: aeron_getifaddrs_func_t, free_func: aeron_freeifaddrs_func_t, )

source

pub fn interface_parse_and_resolve( interface_str: &str, sockaddr: &SockaddrStorage, ) -> Result<usize, AeronCError>

source

pub fn ipv4_netmask_from_prefixlen(prefixlen: usize) -> u32

source

pub fn find_interface( interface_str: &str, if_addr: &SockaddrStorage, if_index: *mut c_uint, ) -> Result<i32, AeronCError>

source

pub fn find_unicast_interface( family: c_int, interface_str: &str, interface_addr: &SockaddrStorage, interface_index: *mut c_uint, ) -> Result<i32, AeronCError>

source

pub fn format_source_identity( buffer: *mut c_char, length: usize, addr: &SockaddrStorage, ) -> Result<i32, AeronCError>

source

pub fn netutil_get_so_buf_lengths( default_so_rcvbuf: &mut usize, default_so_sndbuf: &mut usize, ) -> Result<i32, AeronCError>

source

pub fn parse_size64(str_: &str) -> Result<u64, AeronCError>

source

pub fn parse_duration_ns(str_: &str) -> Result<u64, AeronCError>

source

pub fn parse_bool(str_: &str, def: bool) -> bool

source

pub fn address_split( address_str: &str, parsed_address: &AeronParsedAddress, ) -> Result<i32, AeronCError>

source

pub fn interface_split( interface_str: &str, parsed_interface: &AeronParsedInterface, ) -> Result<i32, AeronCError>

source

pub fn parse_get_line( line: *mut c_char, max_length: usize, buffer: &str, ) -> Result<i32, AeronCError>

source

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

source§

impl Aeron

source

pub fn async_add_counter( &self, type_id: i32, key_buffer: &[u8], label_buffer: &str, ) -> Result<AeronAsyncAddCounter, AeronCError>

source§

impl Aeron

source§

impl Aeron

source

pub fn async_add_subscription<AeronAvailableImageHandlerImpl: AeronAvailableImageCallback, AeronUnavailableImageHandlerImpl: AeronUnavailableImageCallback>( &self, uri: &str, stream_id: i32, on_available_image_handler: Option<&Handler<AeronAvailableImageHandlerImpl>>, on_unavailable_image_handler: Option<&Handler<AeronUnavailableImageHandlerImpl>>, ) -> Result<AeronAsyncAddSubscription, AeronCError>

source§

impl Aeron

§

impl Aeron

pub fn new_blocking( context: &AeronContext, timeout: Duration, ) -> Result<Self, AeronCError>

Trait Implementations§

source§

impl Clone for Aeron

source§

fn clone(&self) -> Aeron

Returns a copy 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 Debug for Aeron

source§

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

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

impl Deref for Aeron

source§

type Target = aeron_stct

The resulting type after dereferencing.
source§

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

Dereferences the value.
source§

impl From<&Aeron> for *mut aeron_t

source§

fn from(value: &Aeron) -> Self

Converts to this type from the input type.
source§

impl From<*const aeron_stct> for Aeron

source§

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

Converts to this type from the input type.
source§

impl From<*mut aeron_stct> for Aeron

source§

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

Converts to this type from the input type.
source§

impl From<Aeron> for *mut aeron_t

source§

fn from(value: Aeron) -> Self

Converts to this type from the input type.
source§

impl From<Aeron> for aeron_t

source§

fn from(value: Aeron) -> Self

Converts to this type from the input type.
source§

impl From<aeron_stct> for Aeron

source§

fn from(value: aeron_t) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Aeron

§

impl !RefUnwindSafe for Aeron

§

impl !Send for Aeron

§

impl !Sync for Aeron

§

impl Unpin for Aeron

§

impl !UnwindSafe for Aeron

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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.