pub struct GhostToken<'brand>(_);
Expand description

WARNING: This attempt at recreating GhostCell but with traits does NOT work.

I am leaving this here because I believe there may exist a way to make this type of token work, and anyone who has ideas of how to do so is welcome to try and make a PR.

To check your theory, clone this repo and use the ghost.rs example as a check for your attempt. If your method works, the example should have some compile error.

Trait Implementations§

Constructs a new Token.
Constructs a new Token, and provides it to the closure. Read more
Returns the Token’s identifier, which cells may store to allow comparison.
Allows the cell to compare its identifier to the Token.

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.