Skip to main content

AeronUriStringBuilder

Struct AeronUriStringBuilder 

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

Source

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.

Source

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>

Source

pub fn params( &self, ) -> AeronStrToPtrHashMap<ScopedInline<'_, aeron_str_to_ptr_hash_map_t>>

Source

pub fn closed(&self) -> bool

Source

pub fn put(&self, key: &CStr, value: &CStr) -> Result<i32, AeronCError>

Source

pub fn put_int32(&self, key: &CStr, value: i32) -> Result<i32, AeronCError>

Source

pub fn put_int64(&self, key: &CStr, value: i64) -> Result<i32, AeronCError>

Source

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.

Source

pub fn get_owned(&self, key: &CStr) -> String

Copy the native text into an owned string. This allocates for nonempty text.

Source

pub fn sprint(&self, buffer: &mut [u8]) -> Result<i32, AeronCError>

Source

pub fn sprint_as_string(&self, max_length: usize) -> Result<String, AeronCError>

Source

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

Source

pub fn set_initial_position( &self, position: i64, initial_term_id: i32, term_length: i32, ) -> Result<i32, AeronCError>

Source

pub fn as_ref(&self) -> Ref<'_, Self>

Borrow this handle without cloning its owner.

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

pub fn reliable(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_UDP_CHANNEL_RELIABLE_KEY.

Source

pub fn ttl(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_UDP_CHANNEL_TTL_KEY.

Source

pub fn endpoint(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_UDP_CHANNEL_ENDPOINT_KEY.

Source

pub fn interface(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_UDP_CHANNEL_INTERFACE_KEY.

Source

pub fn control(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_UDP_CHANNEL_CONTROL_KEY.

Source

pub fn control_mode(&self, value: ControlMode) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_UDP_CHANNEL_CONTROL_MODE_KEY.

Source

pub fn initial_term_id(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_INITIAL_TERM_ID_KEY.

Source

pub fn term_id(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_TERM_ID_KEY.

Source

pub fn term_offset(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_TERM_OFFSET_KEY.

Source

pub fn alias(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_ALIAS_KEY.

Source

pub fn term_length(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_TERM_LENGTH_KEY.

Source

pub fn linger_timeout(&self, value: i64) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_LINGER_TIMEOUT_KEY.

Source

pub fn linger_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>

Set the URI parameter in nanoseconds. Rejects values above i64::MAX.

Source

pub fn mtu_length(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_MTU_LENGTH_KEY.

Source

pub fn sparse_term(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_SPARSE_TERM_KEY.

Source

pub fn eos(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_EOS_KEY.

Source

pub fn tether(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_TETHER_KEY.

Source

pub fn tags(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_TAGS_KEY.

Source

pub fn session_id(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_SESSION_ID_KEY.

Source

pub fn group(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_GROUP_KEY.

Source

pub fn rejoin(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_REJOIN_KEY.

Source

pub fn fc(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_FC_KEY.

Source

pub fn gtag(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_GTAG_KEY.

Source

pub fn cc(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_CC_KEY.

Source

pub fn spies_simulate_connection( &self, value: bool, ) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_SPIES_SIMULATE_CONNECTION_KEY.

Source

pub fn ats(&self, value: bool) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_ATS_KEY.

Source

pub fn socket_sndbuf(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_SOCKET_SNDBUF_KEY.

Source

pub fn socket_rcvbuf(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_SOCKET_RCVBUF_KEY.

Source

pub fn socket_tos(&self, value: u8) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_SOCKET_TOS_KEY.

Source

pub fn receiver_window(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_RECEIVER_WINDOW_KEY.

Source

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.

Source

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.

Source

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.

Source

pub fn response_correlation_id(&self, value: i64) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_RESPONSE_CORRELATION_ID_KEY.

Source

pub fn nak_delay(&self, value: i64) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_NAK_DELAY_KEY.

Source

pub fn nak_delay_duration(&self, value: Duration) -> Result<&Self, AeronCError>

Set the URI parameter in nanoseconds. Rejects values above i64::MAX.

Source

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.

Source

pub fn untethered_window_limit_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>

Set the URI parameter in nanoseconds. Rejects values above i64::MAX.

Source

pub fn untethered_linger_timeout( &self, value: i64, ) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_UNTETHERED_LINGER_TIMEOUT_KEY.

Source

pub fn untethered_linger_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>

Set the URI parameter in nanoseconds. Rejects values above i64::MAX.

Source

pub fn untethered_resting_timeout( &self, value: i64, ) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_UNTETHERED_RESTING_TIMEOUT_KEY.

Source

pub fn untethered_resting_timeout_duration( &self, value: Duration, ) -> Result<&Self, AeronCError>

Set the URI parameter in nanoseconds. Rejects values above i64::MAX.

Source

pub fn max_resend(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_MAX_RESEND_KEY.

Source

pub fn stream_id(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_STREAM_ID_KEY.

Source

pub fn publication_window(&self, value: i32) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_PUBLICATION_WINDOW_KEY.

Source

pub fn prefix(&self, value: &str) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_STRING_BUILDER_PREFIX_KEY.

Source

pub fn media(&self, value: Media) -> Result<&Self, AeronCError>

Set the URI parameter named by AERON_URI_STRING_BUILDER_MEDIA_KEY.

Source§

impl AeronUriStringBuilder

Source

pub fn ipc() -> Result<Self, AeronCError>

Fresh builder for an aeron:ipc channel.

Source

pub fn udp(endpoint: &str) -> Result<Self, AeronCError>

Fresh builder for an aeron:udp channel with the given endpoint (host:port).

Source

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

Source

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.

Source

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.

Source

pub fn build(&self, max_str_length: usize) -> Result<String, AeronCError>

Source

pub fn put_str(&self, key: &CStr, value: &str) -> Result<&Self, AeronCError>

Source

pub fn build_into(&self, dst: &mut String) -> Result<(), AeronCError>

Source

pub fn remove(&self, key: &CStr) -> Result<i32, AeronCError>

Remove a key from the URI builder by setting it to null.

§Example
ⓘ
let builder: AeronUriStringBuilder = "aeron:udp?endpoint=localhost:20121|tags=1,2".parse()?;
builder.remove(c"tags")?;
Source

pub fn remove_str(&self, key: &str) -> Result<i32, AeronCError>

Remove a key from the URI builder by string slice.

§Example
ⓘ
let builder: AeronUriStringBuilder = "aeron:udp?endpoint=localhost:20121|tags=1,2".parse()?;
builder.remove_str("tags")?;

Trait Implementations§

Source§

impl<S: Clone + ResourceStorage<aeron_uri_string_builder_t>> Clone for AeronUriStringBuilder<S>

Source§

fn clone(&self) -> AeronUriStringBuilder<S>

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<S: ResourceStorage<aeron_uri_string_builder_t>> Debug for AeronUriStringBuilder<S>

Source§

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

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

impl Default for AeronUriStringBuilder

Source§

fn default() -> Self

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

impl<S: ResourceStorage<aeron_uri_string_builder_t>> From<&AeronUriStringBuilder<S>> for *mut aeron_uri_string_builder_t

Source§

fn from(value: &AeronUriStringBuilder<S>) -> Self

Converts to this type from the input type.
Source§

impl<S: ResourceStorage<aeron_uri_string_builder_t>> From<AeronUriStringBuilder<S>> for *mut aeron_uri_string_builder_t

Source§

fn from(value: AeronUriStringBuilder<S>) -> Self

Converts to this type from the input type.
Source§

impl<S: ResourceStorage<aeron_uri_string_builder_t>> From<AeronUriStringBuilder<S>> for aeron_uri_string_builder_t

Source§

fn from(value: AeronUriStringBuilder<S>) -> Self

Converts to this type from the input type.
Source§

impl FromStr for AeronUriStringBuilder

Source§

type Err = AeronCError

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

§

impl<S> Freeze for AeronUriStringBuilder<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for AeronUriStringBuilder<S>
where S: RefUnwindSafe,

§

impl<S> Send for AeronUriStringBuilder<S>
where S: Send,

§

impl<S> Sync for AeronUriStringBuilder<S>
where S: Sync,

§

impl<S> Unpin for AeronUriStringBuilder<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for AeronUriStringBuilder<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for AeronUriStringBuilder<S>
where S: UnwindSafe,

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.