Google celebrates Hispanic Heritage Month. See how.

wrap method

InterfaceHandle<T> wrap (T impl)

Returns an interface handle whose peer is bound to the given object.

Creates a channel pair, binds one of the channels to this object, and returns the other channel. Messages sent over the returned channel will be decoded and dispatched to impl.

The impl parameter must not be null.


InterfaceHandle<T>? wrap(T impl) {
  ChannelPair pair = ChannelPair();
  if (pair.status != ZX.OK) {
    return null;
  _impl = impl;

  final callback = onBind;
  if (callback != null) {

  return InterfaceHandle<T>(pair.second);