Struct Dynamic

Source
pub struct Dynamic<A: ScalarAllocator = Global, P: PoolMut<A> = ()> { /* private fields */ }
Expand description

A dynamically created type that is guarnteed to be unique on the given thread and if A::AutoTraits: Send + Sync on the given process.

Dynamic implements OneShotIdentifier if P == (), i.e. there is no pool

Implementations§

Source§

impl Dynamic

Source

pub fn create() -> Self

Create a new Dynamic using the Global ScalarAllocator

Source§

impl<P: PoolMut<Global>> Dynamic<Global, P>

Source

pub fn with_pool(pool: P) -> Self

Create a new Dynamic using the Global ScalarAllocator and the given pool

Source§

impl<A: ScalarAllocator> Dynamic<A>

Source

pub fn with_alloc() -> Self

Create a new Dynamic using the given ScalarAllocator

Source§

impl<A: ScalarAllocator, P: PoolMut<A>> Dynamic<A, P>

Source

pub fn with_alloc_and_pool(pool: P) -> Self

Create a new Dynamic using the given ScalarAllocator and pool

Source§

impl<A: ScalarAllocator, P: PoolMut<A>> Dynamic<A, P>

Source

pub fn owns_token(&self, token: &DynamicToken<A>) -> bool

Checks if self created the given DynamicToken

Source

pub fn token(&self) -> DynamicToken<A>

Creates a DynamicToken

Trait Implementations§

Source§

impl<A: Debug + ScalarAllocator, P: Debug + PoolMut<A>> Debug for Dynamic<A, P>
where A::Scalar: Debug, A::AutoTraits: Debug,

Source§

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

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

impl<A: ScalarAllocator, P: PoolMut<A>> Drop for Dynamic<A, P>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<A: ScalarAllocator, P: PoolMut<A>> Identifier for Dynamic<A, P>

Source§

type Token = DynamicToken<A>

The tokens that this Identifier generates
Source§

fn owns_token(&self, token: &Self::Token) -> bool

Check if this token was created by this identifier
Source§

fn token(&self) -> Self::Token

Create a new token
Source§

impl<A: ScalarAllocator> OneShotIdentifier for Dynamic<A>

Auto Trait Implementations§

§

impl<A, P> Freeze for Dynamic<A, P>
where <A as ScalarAllocator>::Scalar: Freeze, P: Freeze,

§

impl<A, P> RefUnwindSafe for Dynamic<A, P>

§

impl<A, P> Send for Dynamic<A, P>

§

impl<A, P> Sync for Dynamic<A, P>

§

impl<A, P> Unpin for Dynamic<A, P>

§

impl<A, P> UnwindSafe for Dynamic<A, P>

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