pub struct Guard<T> { /* private fields */ }
Expand description

A Guard protects a single Memory address and provides secure access to it, as long as the Guard is not dropped

Implementations

Gets the underlying PTR to the Data protected by the Guard

Loads the most recent Ptr-Value from the given AtomicPtr and updates the current Guard to now protect this new Ptr.

Usage

This should be used when you already have Guard, but no longer need the original Guard/Value and now need to protect another new Memory- Location, as this method reuses an already owned Hazard-Pointer/Guard and therefore does not need to acquire a Hazard-Pointer beforehand.

This is especially useful when iterating a Datastruture, as you often only have one Node you are currently processing and then move on to another one.

Converts the Guard into a Guard for a differnt underlying Type

Safety

You must make sure that the underlying Ptr is valid for the Type O

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.