unbind method

InterfaceHandle<T> unbind ()

Unbinds the proxy and returns the unbound channel as an interface handle.

Calls on the proxy will no longer be encoded as messages on the bound channel.

The proxy must have previously been bound (e.g., using bind).


InterfaceHandle<T> unbind() {
  if (!isBound) {
    throw FidlStateException(
        "AsyncProxyController<${$interfaceName}> isn't bound");
  if (!_reader.isBound) {
    throw FidlError(
        "AsyncProxyController<${$interfaceName}> reader isn't bound");

  state = InterfaceState.closed;

  return InterfaceHandle<T>(_reader.unbind());