pub struct AeronUri { /* private fields */ }Implementations§
Source§impl AeronUri
impl AeronUri
pub fn new( mutable_uri: [c_char; 4096], type_: aeron_uri_type_t, params: aeron_uri_stct__bindgen_ty_1, ) -> Result<Self, AeronCError>
Sourcepub fn new_zeroed_on_heap() -> Self
pub fn new_zeroed_on_heap() -> Self
creates zeroed struct where the underlying c struct is on the heap
Sourcepub fn new_zeroed_on_stack() -> Self
pub fn new_zeroed_on_stack() -> Self
creates zeroed struct where the underlying c struct is on the stack (Use with care)
pub fn mutable_uri(&self) -> [c_char; 4096]
pub fn type_(&self) -> aeron_uri_type_t
pub fn params(&self) -> aeron_uri_stct__bindgen_ty_1
pub fn parse_params<AeronUriParseCallbackHandlerImpl: AeronUriParseCallbackCallback>( uri: *mut c_char, param_func: Option<&Handler<AeronUriParseCallbackHandlerImpl>>, ) -> Result<i32, AeronCError>
Sourcepub fn parse_params_fn<AeronUriParseCallbackHandlerImpl: FnMut(&str, &str) -> c_int>(
uri: *mut c_char,
param_func: AeronUriParseCallbackHandlerImpl,
) -> Result<i32, AeronCError>
pub fn parse_params_fn<AeronUriParseCallbackHandlerImpl: FnMut(&str, &str) -> c_int>( uri: *mut c_char, param_func: AeronUriParseCallbackHandlerImpl, ) -> Result<i32, AeronCError>
Stack-borrowed closure (_fn variant): the FnMut closure lives on the
caller’s stack and is borrowed for this call only — the callback fires
synchronously inside the call, so nothing is heap-allocated, nothing is stored,
and the closure may borrow local state. Prefer this over the retained
Handler-based form on the hot path; only generated for callbacks the C
client does not retain (i.e. not stored for later firing).
§Panics
A panic inside the closure cannot unwind across the extern "C" callback
boundary and aborts the process (since Rust 1.81). Return early instead
of panicking in production fragment handlers.
pub fn parse(&self, uri_length: usize, uri: &CStr) -> Result<i32, AeronCError>
pub fn multicast_ttl(&self) -> u8
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 parse_tag(tag_str: &CStr) -> i64
pub fn get_inner(&self) -> *mut aeron_uri_t
Sourcepub unsafe fn get_inner_mut(&self) -> &mut aeron_uri_t
pub unsafe fn get_inner_mut(&self) -> &mut aeron_uri_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.
pub fn get_inner_ref(&self) -> &aeron_uri_t
Source§impl AeronUri
impl AeronUri
Sourcepub fn close(self) -> Result<(), AeronCError>
pub fn close(self) -> Result<(), AeronCError>
Closes this resource in the C client immediately; all clones of this handle become closed (their pointer is nulled) and must not be used.
Source§impl AeronUri
impl AeronUri
Sourcepub fn clone_struct(&self) -> Self
pub fn clone_struct(&self) -> Self
Regular clone just increases the reference count of underlying count.
clone_struct shallow copies the content of the underlying struct on heap.
NOTE: if the struct has references to other structs these will not be copied
Must be only used on structs which has no init/clean up methods. So its dangerous to use with Aeron/AeronContext/AeronPublication/AeronSubscription More intended for AeronArchiveRecordingDescriptor (note strings will not work as its a shallow copy)
Trait Implementations§
Source§impl Default for AeronUri
This will create an instance where the struct is zeroed, use with care
impl Default for AeronUri
This will create an instance where the struct is zeroed, use with care