the trait bound `&'a std::option::Option<Transaction>: Deserialize<'_>` is not satisfied
the following implementations were found:
<std::option::Option<T> as Deserialize<'de>>rustcE0277
mod.rs(1725, 12): required by a bound in `next_element`
In general, it is not possible to deserialize into a reference – the deserialized data must come from (and be stored/owned) somewhere, and except for very special circumstances, that's not possible unless your data structure owns its contents. Change the type of the puts field to an owning Option<Transaction>, without the reference.
By the way, you don't have to declare fields (or types) as pub in order to derive Deserialize.
I have to use pub and when I remove it I have got this message
the trait bound `&'a std::option::Option<Transaction>: Deserialize<'_>` is not satisfied
the following implementations were found:
<std::option::Option<T> as Deserialize<'de>>rustcE0277
mod.rs(1725, 12): required by a bound in `next_element`