Function replace_implementation

Source
pub fn replace_implementation(
    path_to_setup: &Path,
    id: String,
    has_initial_implementation: bool,
) -> Result<(u16, impl FnOnce(ItemImpl) -> TokenStream), VarError>
Expand description

Replaces the previous implementation marked by the id with a new implementation.
Returns the quantity of previous implementations as well as the function that will actually replace the implementation.

§Be Careful

There is no guarantee on the execution order of procedural macros.
You must take care to make sure that your macros work in all execution orders.

§Errors

It will only error if the crate name cannot be fetched from the environment variables.