This PR adds NodeManager abstraction, which composes NodeStore to provide an interface to create, start or stop nodes. User should pass actor ref of NodeStore to the NodeManager, because it makes it more flexible, i.e. NodeStore does not need to care about how or what NodeStore it uses (please don't change that to avoid unnecessary time waste).
Added new message to Node to make it possible to save the Node having only its ref, it is the case in the NodeManager. This message still returns node, which is a clone made according to the custom Clone trait implementation, which does not include runtime-related data e.g. refs to other actors.
The daemon should only communicate with NodeManager, even if it creates and passes ActorRef to it
It was a bit of fun to implement From trait for converting SendErrors to NodeManagerError. It essentially matches SendError to extract handler error from it or otherwise return other error variant encapsulating some other error. The handler error extracted is expected to implement Into (or NodeManagerError to implement From where T is some handler error) -- this makes it possible to use e.into() to convert that error to NodeManagerError.
Some minor fixes, like getting rid of warnings or replacing drains with into_iter or type NamedRefs declaration to avoid writing HashMap<String, ActorRef> each time
If you want to change something please include your feedback in the code review comments or consult other way, appreciate it :wink:
This PR adds NodeManager abstraction, which composes NodeStore to provide an interface to create, start or stop nodes. User should pass actor ref of NodeStore to the NodeManager, because it makes it more flexible, i.e. NodeStore does not need to care about how or what NodeStore it uses (please don't change that to avoid unnecessary time waste).
If you want to change something please include your feedback in the code review comments or consult other way, appreciate it :wink: