pub struct AeronUriStringBuilder<S: ResourceStorage<aeron_uri_string_builder_t> = CResource<aeron_uri_string_builder_t>> { /* private fields */ }Implementations§
Source§impl AeronUriStringBuilder<CResource<aeron_uri_string_builder_t>>
impl AeronUriStringBuilder<CResource<aeron_uri_string_builder_t>>
Sourcepub unsafe fn new_zeroed_on_heap() -> Self
pub unsafe fn new_zeroed_on_heap() -> Self
Creates zeroed native storage on the heap.
§Safety
For handles with native methods, initialise the native state before calling those methods. Zeroed storage is not a connection.
Sourcepub unsafe fn new_zeroed_on_stack() -> AeronUriStringBuilder<Inline<aeron_uri_string_builder_t>>
pub unsafe fn new_zeroed_on_stack() -> AeronUriStringBuilder<Inline<aeron_uri_string_builder_t>>
Creates zeroed native storage inline.
§Safety
For handles with native methods, initialise the native state before calling those methods. Zeroed storage is not a connection.
Source§impl<S: ResourceStorage<aeron_uri_string_builder_t>> AeronUriStringBuilder<S>
impl<S: ResourceStorage<aeron_uri_string_builder_t>> AeronUriStringBuilder<S>
pub fn params( &self, ) -> AeronStrToPtrHashMap<ScopedInline<'_, aeron_str_to_ptr_hash_map_t>>
pub fn closed(&self) -> bool
pub fn put(&self, key: &CStr, value: &CStr) -> Result<i32, AeronCError>
pub fn put_int32(&self, key: &CStr, value: i32) -> Result<i32, AeronCError>
pub fn put_int64(&self, key: &CStr, value: i64) -> Result<i32, AeronCError>
Sourcepub unsafe fn get(&self, key: &CStr) -> &str
pub unsafe fn get(&self, key: &CStr) -> &str
§Safety
The text points into native storage. A setter, poll or close can rewrite or free it, even through another clone of this handle. Use it straight away, for example to log or copy it, and do not hold it across any call that can change this resource.
Use get_owned() to keep a copy.
Sourcepub fn get_owned(&self, key: &CStr) -> String
pub fn get_owned(&self, key: &CStr) -> String
Copy the native text into an owned string. This allocates for nonempty text.
pub fn sprint(&self, buffer: &mut [u8]) -> Result<i32, AeronCError>
pub fn sprint_as_string(&self, max_length: usize) -> Result<String, AeronCError>
Sourcepub fn sprint_into(
&self,
dst_truncate_to_capacity: &mut String,
) -> Result<i32, AeronCError>
pub fn sprint_into( &self, dst_truncate_to_capacity: &mut String, ) -> Result<i32, AeronCError>
NOTE: allocation friendly method, the string capacity must be set as it will truncate string to capacity it will never grow the string. So if you pass String::new() it will write 0 chars
pub fn set_initial_position( &self, position: i64, initial_term_id: i32, term_length: i32, ) -> Result<i32, AeronCError>
pub fn get_inner(&self) -> *mut aeron_uri_string_builder_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_uri_string_builder_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_uri_string_builder_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.
Sourcepub unsafe fn get_inner_ref(&self) -> &aeron_uri_string_builder_t
pub unsafe fn get_inner_ref(&self) -> &aeron_uri_string_builder_t
Borrow the native struct.
§Safety
No Rust or native call may mutate the struct while this reference is alive. Shared wrappers also require coordination with other threads.
Source§impl AeronUriStringBuilder
impl AeronUriStringBuilder
Sourcepub unsafe fn from_ptr(
ptr: *mut aeron_uri_string_builder_t,
) -> AeronUriStringBuilder<Borrowed<aeron_uri_string_builder_t>>
pub unsafe fn from_ptr( ptr: *mut aeron_uri_string_builder_t, ) -> AeronUriStringBuilder<Borrowed<aeron_uri_string_builder_t>>
Borrow a native pointer without taking ownership.
§Safety
The pointer must be non-null. It and its parents must remain live for every use. Calls must follow Aeron’s threading and aliasing rules.
Sourcepub unsafe fn from_native(
value: aeron_uri_string_builder_t,
) -> AeronUriStringBuilder<Inline<aeron_uri_string_builder_t>>
pub unsafe fn from_native( value: aeron_uri_string_builder_t, ) -> AeronUriStringBuilder<Inline<aeron_uri_string_builder_t>>
Copy a native struct into inline storage.
§Safety
Pointer fields must stay valid for every use of the returned handle.
Source§impl AeronUriStringBuilder
impl AeronUriStringBuilder
Sourcepub fn reliable(&self, value: bool) -> Result<&Self, AeronCError>
pub fn reliable(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_UDP_CHANNEL_RELIABLE_KEY.
Sourcepub fn ttl(&self, value: i32) -> Result<&Self, AeronCError>
pub fn ttl(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_UDP_CHANNEL_TTL_KEY.
Sourcepub fn endpoint(&self, value: &str) -> Result<&Self, AeronCError>
pub fn endpoint(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_UDP_CHANNEL_ENDPOINT_KEY.
Sourcepub fn interface(&self, value: &str) -> Result<&Self, AeronCError>
pub fn interface(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_UDP_CHANNEL_INTERFACE_KEY.
Sourcepub fn control(&self, value: &str) -> Result<&Self, AeronCError>
pub fn control(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_UDP_CHANNEL_CONTROL_KEY.
Sourcepub fn control_mode(&self, value: ControlMode) -> Result<&Self, AeronCError>
pub fn control_mode(&self, value: ControlMode) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_UDP_CHANNEL_CONTROL_MODE_KEY.
Sourcepub fn initial_term_id(&self, value: i32) -> Result<&Self, AeronCError>
pub fn initial_term_id(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_INITIAL_TERM_ID_KEY.
Sourcepub fn term_id(&self, value: i32) -> Result<&Self, AeronCError>
pub fn term_id(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_TERM_ID_KEY.
Sourcepub fn term_offset(&self, value: i32) -> Result<&Self, AeronCError>
pub fn term_offset(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_TERM_OFFSET_KEY.
Sourcepub fn alias(&self, value: &str) -> Result<&Self, AeronCError>
pub fn alias(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_ALIAS_KEY.
Sourcepub fn term_length(&self, value: &str) -> Result<&Self, AeronCError>
pub fn term_length(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_TERM_LENGTH_KEY.
Sourcepub fn linger_timeout(&self, value: i64) -> Result<&Self, AeronCError>
pub fn linger_timeout(&self, value: i64) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_LINGER_TIMEOUT_KEY.
Sourcepub fn linger_timeout_duration(
&self,
value: Duration,
) -> Result<&Self, AeronCError>
pub fn linger_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>
Set the URI parameter in nanoseconds. Rejects values above i64::MAX.
Sourcepub fn mtu_length(&self, value: i32) -> Result<&Self, AeronCError>
pub fn mtu_length(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_MTU_LENGTH_KEY.
Sourcepub fn sparse_term(&self, value: bool) -> Result<&Self, AeronCError>
pub fn sparse_term(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_SPARSE_TERM_KEY.
Sourcepub fn eos(&self, value: bool) -> Result<&Self, AeronCError>
pub fn eos(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_EOS_KEY.
Sourcepub fn tether(&self, value: bool) -> Result<&Self, AeronCError>
pub fn tether(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_TETHER_KEY.
Set the URI parameter named by AERON_URI_TAGS_KEY.
Sourcepub fn session_id(&self, value: &str) -> Result<&Self, AeronCError>
pub fn session_id(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_SESSION_ID_KEY.
Sourcepub fn group(&self, value: bool) -> Result<&Self, AeronCError>
pub fn group(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_GROUP_KEY.
Sourcepub fn rejoin(&self, value: bool) -> Result<&Self, AeronCError>
pub fn rejoin(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_REJOIN_KEY.
Sourcepub fn fc(&self, value: &str) -> Result<&Self, AeronCError>
pub fn fc(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_FC_KEY.
Sourcepub fn gtag(&self, value: &str) -> Result<&Self, AeronCError>
pub fn gtag(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_GTAG_KEY.
Sourcepub fn cc(&self, value: &str) -> Result<&Self, AeronCError>
pub fn cc(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_CC_KEY.
Sourcepub fn spies_simulate_connection(
&self,
value: bool,
) -> Result<&Self, AeronCError>
pub fn spies_simulate_connection( &self, value: bool, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_SPIES_SIMULATE_CONNECTION_KEY.
Sourcepub fn ats(&self, value: bool) -> Result<&Self, AeronCError>
pub fn ats(&self, value: bool) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_ATS_KEY.
Sourcepub fn socket_sndbuf(&self, value: i32) -> Result<&Self, AeronCError>
pub fn socket_sndbuf(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_SOCKET_SNDBUF_KEY.
Sourcepub fn socket_rcvbuf(&self, value: i32) -> Result<&Self, AeronCError>
pub fn socket_rcvbuf(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_SOCKET_RCVBUF_KEY.
Sourcepub fn socket_tos(&self, value: u8) -> Result<&Self, AeronCError>
pub fn socket_tos(&self, value: u8) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_SOCKET_TOS_KEY.
Sourcepub fn receiver_window(&self, value: i32) -> Result<&Self, AeronCError>
pub fn receiver_window(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_RECEIVER_WINDOW_KEY.
Sourcepub fn media_rcv_timestamp_offset(
&self,
value: &str,
) -> Result<&Self, AeronCError>
pub fn media_rcv_timestamp_offset( &self, value: &str, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_MEDIA_RCV_TIMESTAMP_OFFSET_KEY.
Sourcepub fn channel_rcv_timestamp_offset(
&self,
value: &str,
) -> Result<&Self, AeronCError>
pub fn channel_rcv_timestamp_offset( &self, value: &str, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_CHANNEL_RCV_TIMESTAMP_OFFSET_KEY.
Sourcepub fn channel_snd_timestamp_offset(
&self,
value: &str,
) -> Result<&Self, AeronCError>
pub fn channel_snd_timestamp_offset( &self, value: &str, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_CHANNEL_SND_TIMESTAMP_OFFSET_KEY.
Sourcepub fn response_correlation_id(&self, value: i64) -> Result<&Self, AeronCError>
pub fn response_correlation_id(&self, value: i64) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_RESPONSE_CORRELATION_ID_KEY.
Sourcepub fn nak_delay(&self, value: i64) -> Result<&Self, AeronCError>
pub fn nak_delay(&self, value: i64) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_NAK_DELAY_KEY.
Sourcepub fn nak_delay_duration(&self, value: Duration) -> Result<&Self, AeronCError>
pub fn nak_delay_duration(&self, value: Duration) -> Result<&Self, AeronCError>
Set the URI parameter in nanoseconds. Rejects values above i64::MAX.
Sourcepub fn untethered_window_limit_timeout(
&self,
value: i64,
) -> Result<&Self, AeronCError>
pub fn untethered_window_limit_timeout( &self, value: i64, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_UNTETHERED_WINDOW_LIMIT_TIMEOUT_KEY.
Sourcepub fn untethered_window_limit_timeout_duration(
&self,
value: Duration,
) -> Result<&Self, AeronCError>
pub fn untethered_window_limit_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>
Set the URI parameter in nanoseconds. Rejects values above i64::MAX.
Sourcepub fn untethered_linger_timeout(
&self,
value: i64,
) -> Result<&Self, AeronCError>
pub fn untethered_linger_timeout( &self, value: i64, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_UNTETHERED_LINGER_TIMEOUT_KEY.
Sourcepub fn untethered_linger_timeout_duration(
&self,
value: Duration,
) -> Result<&Self, AeronCError>
pub fn untethered_linger_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>
Set the URI parameter in nanoseconds. Rejects values above i64::MAX.
Sourcepub fn untethered_resting_timeout(
&self,
value: i64,
) -> Result<&Self, AeronCError>
pub fn untethered_resting_timeout( &self, value: i64, ) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_UNTETHERED_RESTING_TIMEOUT_KEY.
Sourcepub fn untethered_resting_timeout_duration(
&self,
value: Duration,
) -> Result<&Self, AeronCError>
pub fn untethered_resting_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>
Set the URI parameter in nanoseconds. Rejects values above i64::MAX.
Sourcepub fn max_resend(&self, value: i32) -> Result<&Self, AeronCError>
pub fn max_resend(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_MAX_RESEND_KEY.
Sourcepub fn stream_id(&self, value: i32) -> Result<&Self, AeronCError>
pub fn stream_id(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_STREAM_ID_KEY.
Sourcepub fn publication_window(&self, value: i32) -> Result<&Self, AeronCError>
pub fn publication_window(&self, value: i32) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_PUBLICATION_WINDOW_KEY.
Sourcepub fn prefix(&self, value: &str) -> Result<&Self, AeronCError>
pub fn prefix(&self, value: &str) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_STRING_BUILDER_PREFIX_KEY.
Sourcepub fn media(&self, value: Media) -> Result<&Self, AeronCError>
pub fn media(&self, value: Media) -> Result<&Self, AeronCError>
Set the URI parameter named by AERON_URI_STRING_BUILDER_MEDIA_KEY.
Source§impl AeronUriStringBuilder
impl AeronUriStringBuilder
Sourcepub fn ipc() -> Result<Self, AeronCError>
pub fn ipc() -> Result<Self, AeronCError>
Fresh builder for an aeron:ipc channel.
Sourcepub fn udp(endpoint: &str) -> Result<Self, AeronCError>
pub fn udp(endpoint: &str) -> Result<Self, AeronCError>
Fresh builder for an aeron:udp channel with the given endpoint (host:port).
Sourcepub fn udp_control(
control: &str,
mode: ControlMode,
) -> Result<Self, AeronCError>
pub fn udp_control( control: &str, mode: ControlMode, ) -> Result<Self, AeronCError>
Fresh builder for an aeron:udp multi-destination channel with the given
control endpoint and ControlMode (Dynamic for MDC publications,
Manual for MDS subscriptions/publications, Response for response channels).
Sourcepub fn init_new(&self) -> Result<i32, AeronCError>
pub fn init_new(&self) -> Result<i32, AeronCError>
Initialize a new AeronUriStringBuilder. If already initialized, it will close the previous builder to prevent memory leaks.
Sourcepub fn init_on_string(&self, uri: &CStr) -> Result<i32, AeronCError>
pub fn init_on_string(&self, uri: &CStr) -> Result<i32, AeronCError>
Initialize AeronUriStringBuilder with an existing URI string. If already initialized, it will close the previous builder.
pub fn build(&self, max_str_length: usize) -> Result<String, AeronCError>
pub fn put_str(&self, key: &CStr, value: &str) -> Result<&Self, AeronCError>
pub fn build_into(&self, dst: &mut String) -> Result<(), AeronCError>
Sourcepub fn remove_str(&self, key: &str) -> Result<i32, AeronCError>
pub fn remove_str(&self, key: &str) -> Result<i32, AeronCError>
Trait Implementations§
Source§impl<S: Clone + ResourceStorage<aeron_uri_string_builder_t>> Clone for AeronUriStringBuilder<S>
impl<S: Clone + ResourceStorage<aeron_uri_string_builder_t>> Clone for AeronUriStringBuilder<S>
Source§fn clone(&self) -> AeronUriStringBuilder<S>
fn clone(&self) -> AeronUriStringBuilder<S>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more