[−][src]Struct aeron_rs::context::Context
Context provides configuration for the {@link Aeron} class via the {@link Aeron::Aeron} or {@link Aeron::connect} methods and its overloads. It gives applications some control over the interactions with the Aeron Media Driver. It can also set up error handling as well as application callbacks for connection information from the Media Driver.
Methods
impl Context
[src]
pub fn new() -> Self
[src]
pub fn conclude(&mut self) -> &Self
[src]
pub fn agent_name(&self) -> String
[src]
pub fn set_agent_name(&mut self, name: &str)
[src]
pub fn set_aeron_dir(&mut self, directory: String) -> &Self
[src]
Set the directory that the Aeron client will use to communicate with the media driver.
@param directory to use @return reference to this Context instance
pub fn aeron_dir(&self) -> String
[src]
pub fn cnc_file_name(&self) -> String
[src]
Return the path to the CnC file used by the Aeron client for communication with the media driver.
@return path of the CnC file
pub fn set_error_handler(&mut self, handler: ErrorHandler) -> &Self
[src]
Set the handler for exceptions from the Aeron client.
@param handler called when exceptions arise @return reference to this Context instance
@see default_error_handler for how the default behavior is handled
pub fn error_handler(&self) -> ErrorHandler
[src]
pub fn set_new_publication_handler(
&mut self,
handler: OnNewPublication
) -> &Self
[src]
&mut self,
handler: OnNewPublication
) -> &Self
Set the handler for successful Aeron::add_publication notifications.
@param handler called when add is completed successfully @return reference to this Context instance
pub fn new_publication_handler(&self) -> OnNewPublication
[src]
pub fn set_new_exclusive_publication_handler(
&mut self,
handler: OnNewPublication
) -> &Self
[src]
&mut self,
handler: OnNewPublication
) -> &Self
Set the handler for successful Aeron::add_exclusive_publication notifications.
If not set, then will use new_publication_handler instead.
@param handler called when add is completed successfully @return reference to this Context instance
pub fn new_exclusive_publication_handler(&self) -> OnNewPublication
[src]
pub fn set_new_subscription_handler(
&mut self,
handler: OnNewSubscription
) -> &Self
[src]
&mut self,
handler: OnNewSubscription
) -> &Self
Set the handler for successful Aeron::add_subscription notifications.
@param handler called when add is completed successfully @return reference to this Context instance
pub fn new_subscription_handler(&self) -> OnNewSubscription
[src]
pub fn set_available_image_handler(
&mut self,
handler: OnAvailableImage
) -> &Self
[src]
&mut self,
handler: OnAvailableImage
) -> &Self
Set the handler for available image notifications.
@param handler called when event occurs @return reference to this Context instance
pub fn available_image_handler(&self) -> OnAvailableImage
[src]
pub fn set_unavailable_image_handler(
&mut self,
handler: OnUnavailableImage
) -> &Self
[src]
&mut self,
handler: OnUnavailableImage
) -> &Self
Set the handler for inactive image notifications.
@param handler called when event occurs @return reference to this Context instance
pub fn unavailable_image_handler(&self) -> OnUnavailableImage
[src]
pub fn set_available_counter_handler(
&mut self,
handler: OnAvailableCounter
) -> &Self
[src]
&mut self,
handler: OnAvailableCounter
) -> &Self
Set the handler for available counter notifications.
@param handler called when event occurs @return reference to this Context instance
pub fn available_counter_handler(&self) -> OnAvailableCounter
[src]
pub fn set_unavailable_counter_handler(
&mut self,
handler: OnUnavailableCounter
) -> &Self
[src]
&mut self,
handler: OnUnavailableCounter
) -> &Self
Set the handler for inactive counter notifications.
@param handler called when event occurs @return reference to this Context instance
pub fn unavailable_counter_handler(&self) -> OnUnavailableCounter
[src]
pub fn set_close_client_handler(&mut self, handler: OnCloseClient) -> &Self
[src]
Set the handler to be called when the Aeron client is closed and not longer active.
@param handler to be called when the Aeron client is closed. @return reference to this Context instance.
pub fn close_client_handler(&self) -> OnCloseClient
[src]
pub fn set_media_driver_timeout(&mut self, value: Moment) -> &Self
[src]
Set the amount of time, in milliseconds, that this client will wait until it determines the Media Driver is unavailable. When this happens a DriverTimeoutException will be generated for the error handler.
@param value Number of milliseconds. @return reference to this Context instance @see errorHandler
pub fn media_driver_timeout(&self) -> Moment
[src]
Get the amount of time, in milliseconds, that this client will wait until it determines the Media Driver is unavailable. When this happens a DriverTimeoutException will be generated for the error handler.
@return value in number of milliseconds. @see errorHandler
pub fn set_resource_linger_timeout(&mut self, value: Moment) -> &Self
[src]
Set the amount of time, in milliseconds, that this client will to linger inactive connections and internal arrays before they are free'd.
@param value Number of milliseconds. @return reference to this Context instance
pub fn resource_linger_timeout(&self) -> Moment
[src]
pub fn set_use_conductor_agent_invoker(
&mut self,
use_conductor_agent_invoker: bool
) -> &Self
[src]
&mut self,
use_conductor_agent_invoker: bool
) -> &Self
Set whether to use an invoker to control the conductor agent or spawn a thread.
@param use_conductor_agent_invoker to use an invoker or not. @return reference to this Context instance
pub fn use_conductor_agent_invoker(&self) -> bool
[src]
pub fn set_pre_touch_mapped_memory(
&mut self,
pre_touch_mapped_memory: bool
) -> &Self
[src]
&mut self,
pre_touch_mapped_memory: bool
) -> &Self
Set whether memory mapped files should be pre-touched so they are pre-loaded to avoid later page faults.
@param pre_touch_mapped_memory true to pre-touch memory otherwise false. @return reference to this Context instance
pub fn pre_touch_mapped_memory(&self) -> bool
[src]
pub fn request_driver_termination(
directory: &str,
token_buffer: *mut u8,
token_length: Index
) -> Result<(), AeronError>
[src]
directory: &str,
token_buffer: *mut u8,
token_length: Index
) -> Result<(), AeronError>
pub fn tmp_dir() -> String
[src]
pub fn get_user_name() -> String
[src]
pub fn default_aeron_path() -> String
[src]
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,