[][src]Struct nitric_component::util::InstanceId

pub struct InstanceId { /* fields omitted */ }

A unique ID that can be used to assert two objects refer to another common object.

Example:

We have an allocator type which allocates Foos. Some operations could cause bugs if two Foos from different allocators are used; InstanceId can assert that both are from the same allocator by comparing their InstanceId.

Methods

impl InstanceId
[src]

Creates a new, unique instance id.

Returns the unique usize representation which is used for all the assertions.

Check if self and reference are equal, panic otherwise.

If debug assertions are enabled, check if self and reference are equal, panic otherwise.

Creates a "reference" of this instance id. This is essentially like cloning, but InstanceIds don't implement Clone on purpose since values caring it should never be cloned.

Trait Implementations

impl Default for InstanceId
[src]

impl PartialEq<Reference> for InstanceId
[src]

This method tests for !=.

impl Debug for InstanceId
[src]

Auto Trait Implementations

impl Send for InstanceId

impl Sync for InstanceId

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]