upvote
Yes, destructuring is typically the only allowed way to get rid of linear/indestructible values. If the type has private fields, this is only possible in the same module, so commit(txn) and rollback(txn) would have to be implemented in the same module as the Transaction type.
reply
Exactly - fail_silently is illegal and you have to actually destructure the type to explicitly implement the destructor

> How would you handle destructors with arguments?

https://smallcultfollowing.com/babysteps/blog/2025/10/21/mov...

reply