blob: 5d726a7996e2912ff348998d337d2670f4e5044d [file] [log] [blame] [view]
# request method
[InterfaceRequest](../../package-fidl_fidl/InterfaceRequest-class.md)<T> request
()
<p>Creates an interface request whose peer is bound to this interface proxy.</p>
<p>Creates a channel pair, binds one of the channels to this object, and
returns the other channel. Calls to the proxy will be encoded as messages
and sent to the returned channel.</p>
<p>The proxy must not already have been bound.</p>
## Implementation
```dart
InterfaceRequest<T> request() {
assert(!isBound);
ChannelPair pair = ChannelPair();
assert(pair.status == ZX.OK);
_reader.bind(pair.first!);
_boundCompleter.complete();
final callback = onBind;
if (callback != null) {
callback();
}
return InterfaceRequest<T>(pair.second);
}
```