Struct dynstack::DynStack

source ·
pub struct DynStack<T: ?Sized> { /* private fields */ }

Implementations§

Push a trait object onto the stack.

This method is unsafe because in lieu of moving a trait object onto push’s stack (not possible in rust as of 1.30.0) we copy it from the provided mutable pointer.

The user of this method must therefore either ensure that item has no Drop impl, or explicitly call std::mem::forget on item after pushing.

It is highly recommended to use the dyn_push macro instead of calling this directly.

Remove the last trait object from the stack. Returns true if any items were removed.

Retrieve a trait object reference at the provided index.

Retrieve a mutable trait object reference at the provided index.

Retrieve the trait object reference at the top of the stack.

Retrieve the mutable trait object reference at the top of the stack.

Returns the number of trait objects stored on the stack.

Returns an iterator over trait object references

Returns an iterator over mutable trait object references

Trait Implementations§

Executes the destructor for this type. Read more
The returned type after indexing.
Performs the indexing (container[index]) operation. Read more
Performs the mutable indexing (container[index]) operation. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. 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.