pub struct Ptr<T: ?Sized, A: MemPool> { /* private fields */ }
Expand description

A wrapper around a raw persistent pointer that indicates that the possessor of this wrapper owns the referent. Useful for building abstractions like Pbox<T,P>, Vec<T,P>, and String<P>.

Just like raw pointers, it contains the address of the object, but the address is static within a file.

Note that, memory pools are types, not objects. For more information, please see MemPool.

Implementations

Checks if this pointer is dangling

Returns the file offset

Returns a reference to the file offset

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Size of the object on Persistent Memory Assuming that self is not on PM, or considered else were, the size of allocated persistent memory is the sum of all persistent objects pointed by this object. Read more

Size of the object on Persistent Memory including Self Assuming that self is also on PM (e.g. the root object), the size of allocated persistent memory includes the size of all objects pointed by this object and the size Self. Read more

The allocator does not need to implement PSafe

Ptr pointers are not Send because the data they reference may be aliased.

Ptr pointers are not Sync because the data they reference may be aliased.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

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.