Struct OgreArc

Source
pub struct OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync + 'static,
{ /* private fields */ }
Expand description

Wrapper type for data providing an atomic reference counter for dropping control, similar to Arc, but allowing a custom allocator to be used – BoundedOgreAllocator. providing reference counting similar to Arc

Implementations§

Source§

impl<DataType, OgreAllocatorType> OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source

pub fn new( allocator: &OgreAllocatorType, ) -> Option<(OgreArc<DataType, OgreAllocatorType>, &mut DataType)>

Similar to Self::new_with().
Returns an uninitialized OgreAllocator with a reference to set its value;
None if the allocator is full

Source

pub fn new_with<F>( setter: F, allocator: &OgreAllocatorType, ) -> Option<OgreArc<DataType, OgreAllocatorType>>

Zero-copy the data into one of the slots provided by allocator – which will be used to deallocate it when the time comes – zero-copying will be enforced (if compiled in Release mode) due to this method being inlined in the caller.
None will be returned if there are, currently, no space available for the requested allocation.
A possible usage pattern for use cases that don’t care if we’re out of space is:

        let allocator = <something from ogre_alloc::*>;
        let data = <build your data here>;
        let allocated_data = loop {
            match OgreBox::new_with(|slot| *slot = data, allocator) {
                Some(instance) => break instance,
                None => <<out_of_elements_code>>,   // sleep, warning, etc...
            }
        }
Source

pub fn new_with_clones<const COUNT: usize, F>( setter: F, allocator: &OgreAllocatorType, ) -> Option<[OgreArc<DataType, OgreAllocatorType>; COUNT]>

Similar to [new()], but pre-loads the referenec_count to the specified COUNT value, returning all the clones. This method is faster than calling [new()] & [clone()]

Source

pub fn from_allocated( data_id: u32, allocator: &OgreAllocatorType, ) -> OgreArc<DataType, OgreAllocatorType>

Wraps data with our struct, so it will be properly deallocated when dropped – data must have been previously allocated by the provided allocator

Source

pub fn from_allocated_with_clones<const COUNT: usize>( data_id: u32, allocator: &OgreAllocatorType, ) -> [OgreArc<DataType, OgreAllocatorType>; COUNT]

Similar to [from_allocate()], but pre-loads the reference_count to the specified COUNT value, returning all the clones, which is faster than repetitive calls to [clone()].

Source

pub unsafe fn increment_references( &self, count: u32, ) -> &OgreArc<DataType, OgreAllocatorType>

§Safety

Increments the reference count of the passed [OgreUnique] by count.
To be used in conjunction with [raw_copy()] in order to produce several clones at once, in the hope it will be faster than calling [clone()] several times
IMPORTANT: failure to call [raw_copy()] the same number of times as the parameter to [increment_references()] will crash the program

Source

pub unsafe fn raw_copy(&self) -> OgreArc<DataType, OgreAllocatorType>

§Safety

Copies the [OgreUnique] (a simple 64-bit pointer) without increasing the reference count – but it will still be decreased when dropped.
To be used after a call to [increment_references()] in order to produce several clones at once, in the hope it will be faster than calling [clone()] several times.
IMPORTANT: failure to call [raw_copy()] the same number of times as the parameter to [increment_references()] will crash the program

Source

pub fn references_count(&self) -> u32

Returns how many OgreBox<> copies references the same data as self does

Trait Implementations§

Source§

impl<DataType, OgreAllocatorType> AsRef<DataType> for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn as_ref(&self) -> &DataType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<DataType, OgreAllocatorType> Borrow<DataType> for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn borrow(&self) -> &DataType

Immutably borrows from an owned value. Read more
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelCommon<ItemType, OgreArc<ItemType, OgreAllocatorType>> for Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: Send + Sync + Debug + 'a, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn new<IntoString>( name: IntoString, ) -> Arc<Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>
where IntoString: Into<String>,

Creates a new instance of this channel, to be referred to (in logs) as name
Source§

async fn flush(&self, timeout: Duration) -> u32

Waits until all pending items are taken from this channel, up until timeout elapses.
Returns the number of still unconsumed items – which is 0 if it was not interrupted by the timeout
Source§

fn is_channel_open(&self) -> bool

Tells weather this channel is still enabled to process elements (true before calling the “end stream” / “cancel stream” functions)
Source§

async fn gracefully_end_stream(&self, stream_id: u32, timeout: Duration) -> bool

Flushes & signals that the given stream_id should cease its activities when there are no more elements left to process, waiting for the operation to complete for up to timeout.
Returns true if the stream ended within the given timeout or false if it is still processing elements.
Source§

async fn gracefully_end_all_streams(&self, timeout: Duration) -> u32

Flushes & signals that all streams should cease their activities when there are no more elements left to process, waiting for the operation to complete for up to timeout.
Returns the number of un-ended streams – which is 0 if it was not interrupted by the timeout
Source§

fn cancel_all_streams(&self)

Sends a signal to all streams, urging them to cease their operations.
In opposition to [end_all_streams()], this method does not wait for any confirmation, nor cares if there are remaining elements to be processed.
Source§

fn running_streams_count(&self) -> u32

Informs the caller how many active streams are currently managed by this channel IMPLEMENTORS: #[inline(always)]
Source§

fn pending_items_count(&self) -> u32

Tells how many events are waiting to be taken out of this channel.
IMPLEMENTORS: #[inline(always)]
Source§

fn buffer_size(&self) -> u32

Tells how many events may be produced ahead of the consumers.
IMPLEMENTORS: #[inline(always)]
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelCommon<ItemType, OgreArc<ItemType, OgreAllocatorType>> for FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: Send + Sync + Debug + 'a, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn new<IntoString>( name: IntoString, ) -> Arc<FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>
where IntoString: Into<String>,

Creates a new instance of this channel, to be referred to (in logs) as name
Source§

async fn flush(&self, timeout: Duration) -> u32

Waits until all pending items are taken from this channel, up until timeout elapses.
Returns the number of still unconsumed items – which is 0 if it was not interrupted by the timeout
Source§

fn is_channel_open(&self) -> bool

Tells weather this channel is still enabled to process elements (true before calling the “end stream” / “cancel stream” functions)
Source§

async fn gracefully_end_stream(&self, stream_id: u32, timeout: Duration) -> bool

Flushes & signals that the given stream_id should cease its activities when there are no more elements left to process, waiting for the operation to complete for up to timeout.
Returns true if the stream ended within the given timeout or false if it is still processing elements.
Source§

async fn gracefully_end_all_streams(&self, timeout: Duration) -> u32

Flushes & signals that all streams should cease their activities when there are no more elements left to process, waiting for the operation to complete for up to timeout.
Returns the number of un-ended streams – which is 0 if it was not interrupted by the timeout
Source§

fn cancel_all_streams(&self)

Sends a signal to all streams, urging them to cease their operations.
In opposition to [end_all_streams()], this method does not wait for any confirmation, nor cares if there are remaining elements to be processed.
Source§

fn running_streams_count(&self) -> u32

Informs the caller how many active streams are currently managed by this channel IMPLEMENTORS: #[inline(always)]
Source§

fn pending_items_count(&self) -> u32

Tells how many events are waiting to be taken out of this channel.
IMPLEMENTORS: #[inline(always)]
Source§

fn buffer_size(&self) -> u32

Tells how many events may be produced ahead of the consumers.
IMPLEMENTORS: #[inline(always)]
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelConsumer<'a, OgreArc<ItemType, OgreAllocatorType>> for Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: 'a + Send + Sync + Debug, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn consume( &self, stream_id: u32, ) -> Option<OgreArc<ItemType, OgreAllocatorType>>

Delivers the next event, whenever the Stream wants it.
IMPLEMENTORS: use #[inline(always)]
Source§

fn keep_stream_running(&self, stream_id: u32) -> bool

Returns false if the Stream has been signaled to end its operations, causing it to report “out-of-elements” as soon as possible.
IMPLEMENTORS: use #[inline(always)]
Source§

fn register_stream_waker(&self, stream_id: u32, waker: &Waker)

Shares, to implementors concern, how stream_id may be awaken.
IMPLEMENTORS: use #[inline(always)]
Source§

fn drop_resources(&self, stream_id: u32)

Reports no more elements will be required through [provide()].
IMPLEMENTORS: use #[inline(always)]
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelConsumer<'a, OgreArc<ItemType, OgreAllocatorType>> for FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: 'a + Send + Sync + Debug, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn consume( &self, stream_id: u32, ) -> Option<OgreArc<ItemType, OgreAllocatorType>>

Delivers the next event, whenever the Stream wants it.
IMPLEMENTORS: use #[inline(always)]
Source§

fn keep_stream_running(&self, stream_id: u32) -> bool

Returns false if the Stream has been signaled to end its operations, causing it to report “out-of-elements” as soon as possible.
IMPLEMENTORS: use #[inline(always)]
Source§

fn register_stream_waker(&self, stream_id: u32, waker: &Waker)

Shares, to implementors concern, how stream_id may be awaken.
IMPLEMENTORS: use #[inline(always)]
Source§

fn drop_resources(&self, stream_id: u32)

Reports no more elements will be required through [provide()].
IMPLEMENTORS: use #[inline(always)]
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelMulti<'a, ItemType, OgreArc<ItemType, OgreAllocatorType>> for Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: Send + Sync + Debug + 'a, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn create_stream_for_old_events( self: &Arc<Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> (MutinyStream<'a, ItemType, Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32)

Implemented only for a few [Multi] channels, returns a Stream (and its stream_id) able to receive elements that were sent through this channel before the call to this method.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log based channels are able to see all past events.
If called more than once, every stream will see all the past events available.
Currently panics if called more times than allowed by [Multi]’s MAX_STREAMS
Source§

fn create_stream_for_new_events( self: &Arc<Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> (MutinyStream<'a, ItemType, Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32)

Returns a Stream (and its stream_id) able to receive elements sent through this channel after the call to this method.
If called more than once, each Stream will see all new elements – “listener pattern”.
Currently panics if called more times than allowed by [Multi]’s MAX_STREAMS
Source§

fn create_streams_for_old_and_new_events( self: &Arc<Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> ((MutinyStream<'a, ItemType, Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32), (MutinyStream<'a, ItemType, Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32))

Implemented only for a few [Multi] channels, returns two Streams (and their stream_ids): Read more
Source§

fn create_stream_for_old_and_new_events( self: &Arc<Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> (MutinyStream<'a, ItemType, Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32)

Implemented only for a few [Multi] channels, returns a single Stream (and its stream_id) able to receive elements that were sent through this channel either before and after the call to this method.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log based channels are able to see all past events.
Notice that, with this method, there is no way of discriminating where the “old” events end and where the “new” events start.
If called more than once, every stream will see all the past events available, as well as all future events after this method call.
Currently panics if called more times than allowed by [Multi]’s MAX_STREAMS
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelMulti<'a, ItemType, OgreArc<ItemType, OgreAllocatorType>> for FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: Send + Sync + Debug + 'a, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn create_stream_for_old_events( self: &Arc<FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> (MutinyStream<'a, ItemType, FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32)

Implemented only for a few [Multi] channels, returns a Stream (and its stream_id) able to receive elements that were sent through this channel before the call to this method.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log based channels are able to see all past events.
If called more than once, every stream will see all the past events available.
Currently panics if called more times than allowed by [Multi]’s MAX_STREAMS
Source§

fn create_stream_for_new_events( self: &Arc<FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> (MutinyStream<'a, ItemType, FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32)

Returns a Stream (and its stream_id) able to receive elements sent through this channel after the call to this method.
If called more than once, each Stream will see all new elements – “listener pattern”.
Currently panics if called more times than allowed by [Multi]’s MAX_STREAMS
Source§

fn create_streams_for_old_and_new_events( self: &Arc<FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> ((MutinyStream<'a, ItemType, FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32), (MutinyStream<'a, ItemType, FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32))

Implemented only for a few [Multi] channels, returns two Streams (and their stream_ids): Read more
Source§

fn create_stream_for_old_and_new_events( self: &Arc<FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>>, ) -> (MutinyStream<'a, ItemType, FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>, OgreArc<ItemType, OgreAllocatorType>>, u32)

Implemented only for a few [Multi] channels, returns a single Stream (and its stream_id) able to receive elements that were sent through this channel either before and after the call to this method.
It is up to each implementor to define how back in the past those events may go, but it is known that mmap log based channels are able to see all past events.
Notice that, with this method, there is no way of discriminating where the “old” events end and where the “new” events start.
If called more than once, every stream will see all the past events available, as well as all future events after this method call.
Currently panics if called more times than allowed by [Multi]’s MAX_STREAMS
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelProducer<'a, ItemType, OgreArc<ItemType, OgreAllocatorType>> for Atomic<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: 'a + Send + Sync + Debug, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn send(&self, item: ItemType) -> RetryResult<(), ItemType, (), ()>

Similar to Self::send_with(), but for sending the already-built item.
See there for how to deal with the returned type.
IMPLEMENTORS: #[inline(always)]
Source§

fn send_with<F>(&self, setter: F) -> RetryResult<(), F, (), ()>

Calls setter, passing a slot so the payload may be filled there, then sends the event through this channel asynchronously.
The returned type is conversible to Result<(), F> by calling .into() on it, returning Err<setter> when the buffer is full, to allow the caller to try again; otherwise you may add any retrying logic using the keen-retry crate’s API like in: Read more
Source§

async fn send_with_async<F, Fut>( &'a self, setter: F, ) -> RetryResult<(), F, (), ()>
where F: FnOnce(&'a mut ItemType) -> Fut, Fut: Future<Output = &'a mut ItemType>,

Similar to [Self::send_with(), but accepts an async setter. This method is useful for sending operations that depend on data acquired by async blocks, allowing select loops (like the following) to be built: Read more
Source§

fn send_derived( &self, ogre_arc_item: &OgreArc<ItemType, OgreAllocatorType>, ) -> bool

For channels that stores the DerivedItemType instead of the ItemType, this method may be useful – for instance: if the Stream consumes OgreArc<Type> (the derived item type) and the channel is for Type, with this method one may send an OgreArc directly.
IMPLEMENTORS: #[inline(always)]
Source§

fn reserve_slot(&self) -> Option<&mut ItemType>

Proxy to crate::prelude::advanced::BoundedOgreAllocator::alloc_ref() from the underlying allocator, allowing caller to fill in the data as they wish – in a non-blocking prone API.
See also [Self::send_reserved()] and [Self::cancel_slot_reserve()].
Source§

fn try_send_reserved(&self, reserved_slot: &mut ItemType) -> bool

Attempts to send an item previously reserved by Self::reserve_slot(). Failure to do so (when false is returned) might be part of the normal channel operation, so retrying is advised. More: some channel implementations are optimized (or even only accept) sending the slots in the same order they were reserved.
Source§

fn try_cancel_slot_reserve(&self, reserved_slot: &mut ItemType) -> bool

Attempts to give up sending an item previously reserved by Self::reserve_slot(), freeing it / setting its resources for reuse. Two important things to note: Read more
Source§

impl<'a, ItemType, OgreAllocatorType, const BUFFER_SIZE: usize, const MAX_STREAMS: usize> ChannelProducer<'a, ItemType, OgreArc<ItemType, OgreAllocatorType>> for FullSync<'a, ItemType, OgreAllocatorType, BUFFER_SIZE, MAX_STREAMS>
where ItemType: 'a + Send + Sync + Debug, OgreAllocatorType: BoundedOgreAllocator<ItemType> + 'a + Sync + Send,

Source§

fn send(&self, item: ItemType) -> RetryResult<(), ItemType, (), ()>

Similar to Self::send_with(), but for sending the already-built item.
See there for how to deal with the returned type.
IMPLEMENTORS: #[inline(always)]
Source§

fn send_with<F>(&self, setter: F) -> RetryResult<(), F, (), ()>

Calls setter, passing a slot so the payload may be filled there, then sends the event through this channel asynchronously.
The returned type is conversible to Result<(), F> by calling .into() on it, returning Err<setter> when the buffer is full, to allow the caller to try again; otherwise you may add any retrying logic using the keen-retry crate’s API like in: Read more
Source§

async fn send_with_async<F, Fut>( &'a self, setter: F, ) -> RetryResult<(), F, (), ()>
where F: FnOnce(&'a mut ItemType) -> Fut, Fut: Future<Output = &'a mut ItemType>,

Similar to [Self::send_with(), but accepts an async setter. This method is useful for sending operations that depend on data acquired by async blocks, allowing select loops (like the following) to be built: Read more
Source§

fn send_derived( &self, ogre_arc_item: &OgreArc<ItemType, OgreAllocatorType>, ) -> bool

For channels that stores the DerivedItemType instead of the ItemType, this method may be useful – for instance: if the Stream consumes OgreArc<Type> (the derived item type) and the channel is for Type, with this method one may send an OgreArc directly.
IMPLEMENTORS: #[inline(always)]
Source§

fn reserve_slot(&self) -> Option<&mut ItemType>

Proxy to crate::prelude::advanced::BoundedOgreAllocator::alloc_ref() from the underlying allocator, allowing caller to fill in the data as they wish – in a non-blocking prone API.
See also [Self::send_reserved()] and [Self::cancel_slot_reserve()].
Source§

fn try_send_reserved(&self, reserved_slot: &mut ItemType) -> bool

Attempts to send an item previously reserved by Self::reserve_slot(). Failure to do so (when false is returned) might be part of the normal channel operation, so retrying is advised. More: some channel implementations are optimized (or even only accept) sending the slots in the same order they were reserved.
Source§

fn try_cancel_slot_reserve(&self, reserved_slot: &mut ItemType) -> bool

Attempts to give up sending an item previously reserved by Self::reserve_slot(), freeing it / setting its resources for reuse. Two important things to note: Read more
Source§

impl<DataType, OgreAllocatorType> Clone for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn clone(&self) -> OgreArc<DataType, OgreAllocatorType>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<DataType, OgreAllocatorType> Debug for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

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

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

impl<DataType, OgreAllocatorType> Default for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn default() -> OgreArc<DataType, OgreAllocatorType>

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

impl<DataType, OgreAllocatorType> Deref for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

type Target = DataType

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<OgreArc<DataType, OgreAllocatorType> as Deref>::Target

Dereferences the value.
Source§

impl<DataType, OgreAllocatorType> DerefMut for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn deref_mut( &mut self, ) -> &mut <OgreArc<DataType, OgreAllocatorType> as Deref>::Target

Mutably dereferences the value.
Source§

impl<DataType, OgreAllocatorType> Display for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync + Display, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

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

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

impl<DataType, OgreAllocatorType> Drop for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<DataType, OgreAllocatorType> From<OgreUnique<DataType, OgreAllocatorType>> for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn from( ogre_unique: OgreUnique<DataType, OgreAllocatorType>, ) -> OgreArc<DataType, OgreAllocatorType>

Converts to this type from the input type.
Source§

impl<DataType, OgreAllocatorType> PartialEq for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync + PartialEq, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

fn eq(&self, other: &OgreArc<DataType, OgreAllocatorType>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<DataType, OgreAllocatorType> Send for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Source§

impl<DataType, OgreAllocatorType> Sync for OgreArc<DataType, OgreAllocatorType>
where DataType: Debug + Send + Sync, OgreAllocatorType: BoundedOgreAllocator<DataType> + Send + Sync,

Auto Trait Implementations§

§

impl<DataType, OgreAllocatorType> Freeze for OgreArc<DataType, OgreAllocatorType>

§

impl<DataType, OgreAllocatorType> RefUnwindSafe for OgreArc<DataType, OgreAllocatorType>
where OgreAllocatorType: RefUnwindSafe, DataType: RefUnwindSafe,

§

impl<DataType, OgreAllocatorType> Unpin for OgreArc<DataType, OgreAllocatorType>

§

impl<DataType, OgreAllocatorType> UnwindSafe for OgreArc<DataType, OgreAllocatorType>
where OgreAllocatorType: RefUnwindSafe, DataType: RefUnwindSafe,

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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V