bind method

void bind (InterfaceHandle<T> interfaceHandle)

Implementation

void bind(InterfaceHandle<T> interfaceHandle) {
  if (!isUnbound) {
    throw FidlStateException(
        "AsyncProxyController<${$interfaceName}> isn't unbound");
  }

  final channel = interfaceHandle.passChannel();
  if (channel == null) {
    throw FidlError(
        "AsyncProxyController<${$interfaceName}> can't bind to null InterfaceHandle channel");
  }

  _reader.bind(channel);
  state = InterfaceState.bound;
}