|
Arc::try_unwrap(self.port.take().unwrap()).unwrap().shutdown(); |
Currently, it fails to drop the context when the port is still held by others. But, there is no way to guarantee whether all other holders released before the context dropped.
How about dropping context calls shutdown and making the methods of the Port returns a Result?
It also should make the shutdown of the Port takes the mutable reference of the self. It means the user can access the port after shutdown, but I think this would be safer.
remote-trait-object/remote-trait-object/src/context.rs
Line 63 in 7ac07c7
Currently, it fails to drop the context when the port is still held by others. But, there is no way to guarantee whether all other holders released before the context dropped.
How about dropping context calls shutdown and making the methods of the
Portreturns aResult?It also should make the shutdown of the
Porttakes the mutable reference of the self. It means the user can access the port after shutdown, but I think this would be safer.