pub struct DynDynFat<B: ?Sized + DynDynBase, P> { /* private fields */ }
Expand description

A fat pointer to an object that can be downcast via the base trait object B.

Such a pointer will only perform a call to retrieve the DynDynTable of the referenced object once when created. Thereafter, the cached table will be used for trait object metadata lookups. This effectively avoids the overhead of the repeated indirect calls to retrieve the table at the cost of increasing the size of the pointer to the object.

Implementations

Creates a new fat pointer with the provided pointer and DynDynTable.

Safety

table must refer to the same table as a table that would be returned by calling GetDynDynTable::get_dyn_dyn_table on ptr at the time that this function is called.

Creates a new fat pointer wrapping the provided pointer. This will immediately get the pointer’s DynDynTable by calling GetDynDynTable<B>::get_dyn_dyn_table and cache it for future use.

Gets the DynDynTable of the object referenced by a fat pointer without dereferencing it.

Unwraps a fat pointer, returning the pointer originally used to construct it.

Dereferences a fat pointer to produce a fat pointer with a reference.

Dereferences a fat pointer to produce a fat pointer with a mutable reference.

Clones a fat pointer without verifying that the DynDynTable held by the new fat pointer is applicable to the cloned pointer.

Safety

The caller must guarantee that the result of calling ptr.clone() will dereference to an object having the same concrete type as that pointed to by ptr.

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

The result of downcasting this pointer to point to the type D. Note that this type need not have the same outer wrapper as the type implementing DowncastUnchecked, since the result of the downcast may involve coercions and dereferences. Read more

Downcasts this pointer into a new pointer pointing to the same object, but having type D. Read more

Converts to this type from the input type.

The actual type that this pointer currently points to. This type is used to allow propagation of auto trait bounds such as Send and Sync in the dyn_dyn_cast! macro. Read more

Gets the DynDynTable for the object that this pointer points to.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Formats the value using the given formatter.

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

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.