blob: 90890b2d71a4964f3d10eea71413ace84b4e014d [file] [log] [blame] [view] [edit]
# InterfaceHandle<T> class
<p>A channel over which messages from interface T can be sent.</p>
<p>An interface handle holds a <a href="../package-fidl_fidl/InterfaceHandle/channel.md">channel</a> whose peer expects to receive messages
from the FIDL interface T. The channel held by an interface handle is not
currently bound, which means messages cannot yet be exchanged with the
channel's peer.</p>
<p>To send messages over the channel, bind the interface handle to a <code>TProxy</code>
object using use <code>ProxyController&lt;T&gt;.bind</code> method on the proxy's
<code>Proxy&lt;T&gt;.ctrl</code> property.</p>
<p>Example:</p>
<pre class="language-dart"><code class="language-dart">InterfaceHandle&lt;T&gt; fooHandle = [...]
FooProxy foo = new FooProxy();
foo.ctrl.bind(fooHandle);
foo.bar();
</code></pre>
<p>To obtain an interface handle to send over a channel, used the
<code>Binding&lt;T&gt;.wrap</code> method on an object of type <code>TBinding</code>.</p>
<p>Example:</p>
<pre class="language-dart"><code class="language-dart">class FooImpl extends Foo {
final FooBinding _binding = new FooBinding();
InterfaceHandle&lt;T&gt; getInterfaceHandle() =&gt; _binding.wrap(this);
@override
void bar() {
print('Received bar message.');
}
}
</code></pre>
## Constructors
[InterfaceHandle](../package-fidl_fidl/InterfaceHandle/InterfaceHandle.md) ([Channel](../zircon/Channel-class.md) _channel)
Creates an interface handle that wraps the given channel.
## Properties
##### [channel](../package-fidl_fidl/InterfaceHandle/channel.md) &#8594; [Channel](../zircon/Channel-class.md)
The underlying channel messages will be sent over when the interface
handle is bound to a <a href="../package-fidl_fidl/Proxy-class.md">Proxy</a>. [...](../package-fidl_fidl/InterfaceHandle/channel.md)
_read-only_
##### [hashCode](../package-fidl_fidl/InterfaceHandle/hashCode.md) &#8594; int
The hash code for this object. [...](../package-fidl_fidl/InterfaceHandle/hashCode.md)
_read-only, inherited_
##### [runtimeType](../package-fidl_fidl/InterfaceHandle/runtimeType.md) &#8594; Type
A representation of the runtime type of the object.
_read-only, inherited_
## Methods
##### [close](../package-fidl_fidl/InterfaceHandle/close.md)() void
Closes the underlying channel.
##### [noSuchMethod](../package-fidl_fidl/InterfaceHandle/noSuchMethod.md)(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed. [...](../package-fidl_fidl/InterfaceHandle/noSuchMethod.md)
_inherited_
##### [passChannel](../package-fidl_fidl/InterfaceHandle/passChannel.md)() [Channel](../zircon/Channel-class.md)
Returns <a href="../package-fidl_fidl/InterfaceHandle/channel.md">channel</a> and sets <a href="../package-fidl_fidl/InterfaceHandle/channel.md">channel</a> to <code>null</code>. [...](../package-fidl_fidl/InterfaceHandle/passChannel.md)
##### [toString](../package-fidl_fidl/InterfaceHandle/toString.md)() String
A string representation of this object. [...](../package-fidl_fidl/InterfaceHandle/toString.md)
_inherited_
## Operators
##### [operator ==](../package-fidl_fidl/InterfaceHandle/operator_equals.md)(Object other) bool
The equality operator. [...](../package-fidl_fidl/InterfaceHandle/operator_equals.md)
_inherited_