Struct heron::rapier_plugin::rapier::crossbeam::epoch::Owned [−]
An owned heap-allocated object.
This type is very similar to Box<T>
.
The pointer must be properly aligned. Since it is aligned, a tag can be stored into the unused least significant bits of the address.
Implementations
impl<T> Owned<T>
pub unsafe fn from_raw(raw: *mut T) -> Owned<T>
Returns a new owned pointer pointing to raw
.
This function is unsafe because improper use may lead to memory problems. Argument raw
must be a valid pointer. Also, a double-free may occur if the function is called twice on
the same raw pointer.
Panics
Panics if raw
is not properly aligned.
Safety
The given raw
should have been derived from Owned
, and one raw
should not be converted
back by Owned::from_raw()
multiple times.
Examples
use crossbeam_epoch::Owned; let o = unsafe { Owned::from_raw(Box::into_raw(Box::new(1234))) };
pub fn into_box(self) -> Box<T, Global>
Converts the owned pointer into a Box
.
Examples
use crossbeam_epoch::Owned; let o = Owned::new(1234); let b: Box<i32> = o.into_box(); assert_eq!(*b, 1234);
pub fn new(init: T) -> Owned<T>
Allocates value
on the heap and returns a new owned pointer pointing to it.
Examples
use crossbeam_epoch::Owned; let o = Owned::new(1234);
impl<T> Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
pub fn init(init: <T as Pointable>::Init) -> Owned<T>
Allocates value
on the heap and returns a new owned pointer pointing to it.
Examples
use crossbeam_epoch::Owned; let o = Owned::<i32>::init(1234);
pub fn into_shared(self, &'g Guard) -> Shared<'g, T>
Converts the owned pointer into a Shared
.
Examples
use crossbeam_epoch::{self as epoch, Owned}; let o = Owned::new(1234); let guard = &epoch::pin(); let p = o.into_shared(guard);
pub fn tag(&self) -> usize
Returns the tag stored within the pointer.
Examples
use crossbeam_epoch::Owned; assert_eq!(Owned::new(1234).tag(), 0);
pub fn with_tag(self, tag: usize) -> Owned<T>
Returns the same pointer, but tagged with tag
. tag
is truncated to be fit into the
unused bits of the pointer to T
.
Examples
use crossbeam_epoch::Owned; let o = Owned::new(0u64); assert_eq!(o.tag(), 0); let o = o.with_tag(2); assert_eq!(o.tag(), 2);
Trait Implementations
impl<T> AsMut<T> for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
impl<T> AsRef<T> for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
impl<T> Borrow<T> for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
impl<T> BorrowMut<T> for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
impl<T> Clone for Owned<T> where
T: Clone,
T: Clone,
pub fn clone(&self) -> Owned<T>
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
impl<T> Deref for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
impl<T> DerefMut for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
impl<T> Drop for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
pub fn drop(&mut self)
impl<T> From<Box<T, Global>> for Owned<T>
impl<T> From<Owned<T>> for Atomic<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
pub fn from(owned: Owned<T>) -> Atomic<T>
Returns a new atomic pointer pointing to owned
.
Examples
use crossbeam_epoch::{Atomic, Owned}; let a = Atomic::<i32>::from(Owned::new(1234));
impl<T> From<T> for Owned<T>
impl<T> Pointer<T> for Owned<T> where
T: Pointable + ?Sized,
T: Pointable + ?Sized,
pub fn into_usize(self) -> usize
pub unsafe fn from_usize(data: usize) -> Owned<T>
Returns a new pointer pointing to the tagged pointer data
.
Panics
Panics if the data is zero in debug mode.
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for Owned<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T: ?Sized> Send for Owned<T> where
T: Send,
T: Send,
impl<T: ?Sized> Sync for Owned<T> where
T: Sync,
T: Sync,
impl<T: ?Sized> Unpin for Owned<T>
impl<T: ?Sized> UnwindSafe for Owned<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,
impl<T> Component for T where
T: 'static + Send + Sync,
T: 'static + Send + Sync,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> Downcast<T> for T
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> From<!> for T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S, T> ParallelSlice<T> for S where
T: Sync,
S: AsRef<[T]>,
T: Sync,
S: AsRef<[T]>,
pub fn par_chunk_map<F, R>(
&self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global> where
F: Fn(&[T]) -> R + Send + Sync,
R: Send + 'static,
&self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global> where
F: Fn(&[T]) -> R + Send + Sync,
R: Send + 'static,
pub fn par_splat_map<F, R>(
&self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global> where
F: Fn(&[T]) -> R + Send + Sync,
R: Send + 'static,
&self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global> where
F: Fn(&[T]) -> R + Send + Sync,
R: Send + 'static,
impl<S, T> ParallelSliceMut<T> for S where
T: Send,
S: AsMut<[T]>,
T: Send,
S: AsMut<[T]>,
pub fn par_chunk_map_mut<F, R>(
&mut self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global> where
F: Fn(&mut [T]) -> R + Send + Sync,
R: Send + 'static,
&mut self,
task_pool: &TaskPool,
chunk_size: usize,
f: F
) -> Vec<R, Global> where
F: Fn(&mut [T]) -> R + Send + Sync,
R: Send + 'static,
pub fn par_splat_map_mut<F, R>(
&mut self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global> where
F: Fn(&mut [T]) -> R + Send + Sync,
R: Send + 'static,
&mut self,
task_pool: &TaskPool,
max_tasks: Option<usize>,
f: F
) -> Vec<R, Global> where
F: Fn(&mut [T]) -> R + Send + Sync,
R: Send + 'static,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
SS: SubsetOf<SP>,
pub fn to_subset(&self) -> Option<SS>
pub fn is_in_subset(&self) -> bool
pub fn to_subset_unchecked(&self) -> SS
pub fn from_subset(element: &SS) -> SP
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
pub fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
pub fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> TypeData for T where
T: 'static + Send + Sync + Clone,
T: 'static + Send + Sync + Clone,
pub fn clone_type_data(&self) -> Box<dyn TypeData + 'static, Global>
impl<T> Upcast<T> for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,