Skip to main content

Ref

Struct Ref 

Source
pub struct Ref<'a, T> { /* private fields */ }
Expand description

A wrapper around a C object that belongs to the value it came from, such as the context returned by archive.get_archive_context()

The lifetime ties it to that owner, so dropping or closing the owner while a Ref is alive does not compile. Use it through Deref like the wrapper itself

The owner is tracked with PhantomData rather than an Rc/Arc clone for performance: getters such as archive.aeron() are called on the hot path (for example in do_work), and a reference count would add an increment and decrement (atomic under multi-threaded) on every call. Ref holds only the C pointer, so the borrow checker enforces the lifetime at zero runtime cost

ref.clone() keeps the lifetime. Cloning the inner wrapper (T::clone(&*r)) does not, and that copy must not outlive the owner

Implementations§

Source§

impl<'a> Ref<'a, Addrinfo>

Source

pub fn ai_addr(&self) -> Ref<'a, Sockaddr>

Source

pub fn ai_next(&self) -> Ref<'a, Addrinfo>

Source§

impl<'a> Ref<'a, AeronBroadcastTransmitter>

Source§

impl<'a> Ref<'a, AeronCnc>

Source

pub fn counters_reader(&self) -> Ref<'a, AeronCountersReader>

Gets a counters reader for this command and control file. This does not need to be closed manually, resources are tied to the instance of aeron_cnc.

§Return

pointer to a counters reader.

Source§

impl<'a> Ref<'a, AeronCountersManager>

Source

pub fn cached_clock(&self) -> Ref<'a, AeronClockCache>

Source§

impl<'a> Ref<'a, AeronDataPacketDispatcher>

Source§

impl<'a> Ref<'a, AeronDistinctErrorLogObservationList>

Source§

impl<'a> Ref<'a, AeronDistinctErrorLog>

Source§

impl<'a> Ref<'a, AeronDriverConductorClientCommand>

Source§

impl<'a> Ref<'a, AeronDriverConductorProxy>

Source

pub fn conductor(&self) -> Ref<'a, AeronDriverConductor>

Source

pub fn command_queue(&self) -> Ref<'a, AeronMpscRb>

Source§

impl<'a> Ref<'a, AeronDriverConductor>

Source§

impl<'a> Ref<'a, AeronDriverContext>

Source

pub fn get_udp_channel_outgoing_interceptors( &self, ) -> Ref<'a, AeronUdpChannelInterceptorBindings>

Source

pub fn get_udp_channel_incoming_interceptors( &self, ) -> Ref<'a, AeronUdpChannelInterceptorBindings>

Source

pub fn get_conductor_duty_cycle_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn get_sender_duty_cycle_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn get_receiver_duty_cycle_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn get_name_resolver_time_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn get_sender_port_manager(&self) -> Ref<'a, AeronPortManager>

Source

pub fn get_receiver_port_manager(&self) -> Ref<'a, AeronPortManager>

Source

pub fn cached_clock(&self) -> Ref<'a, AeronClockCache>

Source

pub fn sender_cached_clock(&self) -> Ref<'a, AeronClockCache>

Source

pub fn receiver_cached_clock(&self) -> Ref<'a, AeronClockCache>

Source

pub fn conductor_proxy(&self) -> Ref<'a, AeronDriverConductorProxy>

Source

pub fn native_resource_agent_proxy( &self, ) -> Ref<'a, AeronDriverNativeResourceAgentProxy>

Source

pub fn sender_proxy(&self) -> Ref<'a, AeronDriverSenderProxy>

Source

pub fn receiver_proxy(&self) -> Ref<'a, AeronDriverReceiverProxy>

Source

pub fn counters_manager(&self) -> Ref<'a, AeronCountersManager>

Source

pub fn system_counters(&self) -> Ref<'a, AeronSystemCounters>

Source

pub fn error_log(&self) -> Ref<'a, AeronDistinctErrorLog>

Source

pub fn udp_channel_outgoing_interceptor_bindings( &self, ) -> Ref<'a, AeronUdpChannelInterceptorBindings>

Source

pub fn udp_channel_incoming_interceptor_bindings( &self, ) -> Ref<'a, AeronUdpChannelInterceptorBindings>

Source

pub fn conductor_duty_cycle_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn sender_duty_cycle_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn receiver_duty_cycle_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn name_resolver_time_tracker(&self) -> Ref<'a, AeronDutyCycleTracker>

Source

pub fn sender_port_manager(&self) -> Ref<'a, AeronPortManager>

Source

pub fn receiver_port_manager(&self) -> Ref<'a, AeronPortManager>

Source

pub fn dynamic_libs(&self) -> Ref<'a, AeronDlLoadedLibsState>

Source

pub fn bindings_clientd_entries( &self, ) -> Ref<'a, AeronDriverContextBindingsClientdEntry>

Source§

impl<'a> Ref<'a, AeronDriverNativeResourceAgentProxyCmdFreeLogBuffer>

Source§

impl<'a> Ref<'a, AeronDriverNativeResourceAgentProxyCmdMapLogBuffer>

Source§

impl<'a> Ref<'a, AeronDriverNativeResourceAgentProxyCmdParseChannel>

Source§

impl<'a> Ref<'a, AeronDriverNativeResourceAgentProxyCmdResolveAddress>

Source§

impl<'a> Ref<'a, AeronDriverNativeResourceAgentProxy>

Source§

impl<'a> Ref<'a, AeronDriverNativeResourceAgent>

Source

pub fn context(&self) -> Ref<'a, AeronDriverContext>

Source§

impl<'a> Ref<'a, AeronDriverReceiverImageEntry>

Source

pub fn image(&self) -> Ref<'a, AeronPublicationImage>

Source§

impl<'a> Ref<'a, AeronDriverReceiverPendingSetupEntry>

Source§

impl<'a> Ref<'a, AeronDriverReceiverProxy>

Source

pub fn receiver(&self) -> Ref<'a, AeronDriverReceiver>

Source

pub fn command_queue(&self) -> Ref<'a, AeronSpscRb>

Source§

impl<'a> Ref<'a, AeronDriverReceiver>

Source§

impl<'a> Ref<'a, AeronDriverSenderNetworkPublicationEntry>

Source§

impl<'a> Ref<'a, AeronDriverSenderProxy>

Source

pub fn sender(&self) -> Ref<'a, AeronDriverSender>

Source

pub fn command_queue(&self) -> Ref<'a, AeronSpscRb>

Source§

impl<'a> Ref<'a, AeronDriverSender>

Source§

impl<'a> Ref<'a, AeronDriver>

Source

pub fn context(&self) -> Ref<'a, AeronDriverContext>

Source§

impl<'a> Ref<'a, AeronImageConstants>

Source§

impl<'a> Ref<'a, AeronInt64ToTaggedPtrHashMap>

Source§

impl<'a> Ref<'a, AeronIpcPublicationEntry>

Source§

impl<'a> Ref<'a, AeronIpcPublication>

Source§

impl<'a> Ref<'a, AeronLossDetector>

Source§

impl<'a> Ref<'a, AeronMpscRb>

Source

pub fn descriptor(&self) -> Ref<'a, AeronRbDescriptor>

Source§

impl<'a> Ref<'a, AeronNetworkPublicationEntry>

Source§

impl<'a> Ref<'a, AeronNetworkPublication>

Source§

impl<'a> Ref<'a, AeronPublicationImageConnection>

Source§

impl<'a> Ref<'a, AeronPublicationImageEntry>

Source§

impl<'a> Ref<'a, AeronPublicationImage>

Source§

impl<'a> Ref<'a, AeronPublicationLink>

Source§

impl<'a> Ref<'a, AeronReceiveChannelEndpointEntry>

Source§

impl<'a> Ref<'a, AeronReceiveChannelEndpoint>

Source§

impl<'a> Ref<'a, AeronReceiveDestinationEntry>

Source§

impl<'a> Ref<'a, AeronReceiveDestination>

Source§

impl<'a> Ref<'a, AeronRetransmitHandler>

Source§

impl<'a> Ref<'a, AeronSendChannelEndpointEntry>

Source§

impl<'a> Ref<'a, AeronSendChannelEndpoint>

Source§

impl<'a> Ref<'a, AeronSpscRb>

Source

pub fn descriptor(&self) -> Ref<'a, AeronRbDescriptor>

Source§

impl<'a> Ref<'a, AeronStrToPtrHashMap>

Source

pub fn keys(&self) -> Ref<'a, AeronStrToPtrHashMapKey>

Source§

impl<'a> Ref<'a, AeronSubscribableListEntry>

Source§

impl<'a> Ref<'a, AeronSubscribable>

Source§

impl<'a> Ref<'a, AeronSubscriptionLink>

Source§

impl<'a> Ref<'a, AeronSystemCounters>

Source

pub fn manager(&self) -> Ref<'a, AeronCountersManager>

Source§

impl<'a> Ref<'a, Aeron>

Source

pub fn context(&self) -> Ref<'a, 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 counters_reader(&self) -> Ref<'a, 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§

impl<'a> Ref<'a, AeronUdpChannelAsyncParse>

Source

pub fn channel(&self) -> Ref<'a, AeronUdpChannel>

Source§

impl<'a> Ref<'a, AeronUdpChannelDataPaths>

Source§

impl<'a> Ref<'a, AeronUdpChannelIncomingInterceptor>

Source§

impl<'a> Ref<'a, AeronUdpChannelOutgoingInterceptor>

Source§

impl<'a> Ref<'a, AeronUdpDestinationEntry>

Source

pub fn uri(&self) -> Ref<'a, AeronUri>

Source§

impl<'a> Ref<'a, AeronUdpDestinationTracker>

Source§

impl<'a> Ref<'a, AeronUriParams>

Source

pub fn array(&self) -> Ref<'a, AeronUriParam>

Source§

impl<'a> Ref<'a, Ifaddrs>

Source

pub fn ifa_next(&self) -> Ref<'a, Ifaddrs>

Source

pub fn ifa_addr(&self) -> Ref<'a, Sockaddr>

Source

pub fn ifa_netmask(&self) -> Ref<'a, Sockaddr>

Source§

impl<'a> Ref<'a, Msghdr>

Source

pub fn msg_iov(&self) -> Ref<'a, Iovec>

Trait Implementations§

Source§

impl<T: Clone> Clone for Ref<'_, T>

Source§

fn clone(&self) -> Self

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<T: Debug> Debug for Ref<'_, T>

Source§

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

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

impl<T> Deref for Ref<'_, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.

Auto Trait Implementations§

§

impl<'a, T> Freeze for Ref<'a, T>
where T: Freeze,

§

impl<'a, T> RefUnwindSafe for Ref<'a, T>
where T: RefUnwindSafe,

§

impl<'a, T> Send for Ref<'a, T>
where T: Send,

§

impl<'a, T> Sync for Ref<'a, T>
where T: Sync,

§

impl<'a, T> Unpin for Ref<'a, T>
where T: Unpin,

§

impl<'a, T> UnsafeUnpin for Ref<'a, T>
where T: UnsafeUnpin,

§

impl<'a, T> UnwindSafe for Ref<'a, T>
where T: 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.