stratisd
stratisd copied to clipboard
Destroy and teardown should somehow mark layers of the stack as torn down on success
@mulkieran While working on #2355, I noticed that a lot of our destroy methods take &mut self. Would it make more sense here to use self and let Rust's ownership checking guarantee that the entity can't be used after it's destroyed? I need to at least change this for the crypt layer as I've tried to make the code simpler by guaranteeing that if you have a CryptHandle, the device is active. However, I'm wondering if this would add a benefit across our code base.
I think this is now obsolete.
Reopening this because of #3274 and #3285
I think taking self is actually a bad idea just because of the fallible nature of the teardown methods. I'd almost rather still take &mut self but create a new data type to mark a layer as deactivated so that it can't be accessed afterwards. I think this is a larger and longer term redesign so I'm going to put this to the side for now.