blob: 508a576a2c0cdd4890c3264f70c495138ba80a0b [file] [log] [blame] [view]
# unbind method
[InterfaceHandle](../../package-fidl_fidl/InterfaceHandle-class.md)<T> unbind
()
<p>Unbinds the proxy and returns the unbound channel as an interface handle.</p>
<p>Calls on the proxy will no longer be encoded as messages on the bound
channel.</p>
<p>The proxy must have previously been bound (e.g., using <a href="../../package-fidl_fidl/AsyncProxyController/bind.md">bind</a>).</p>
## Implementation
```dart
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());
}
```