blob: 42326d391a017135ee04aac567e6e13a14115364 [file] [log] [blame] [view]
# 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 <a href="../package-fidl_fidl/ProxyController/bind.md">ProxyController&lt;T&gt;.bind</a> method on the proxy's
<a href="../package-fidl_fidl/Proxy/ctrl.md">Proxy&lt;T&gt;.ctrl</a> 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
<a href="../package-fidl_fidl/Binding/wrap.md">Binding&lt;T&gt;.wrap</a> 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>.
_<span class="feature read-only">read-only</span>_
##### [hashCode](../package-fidl_fidl/InterfaceHandle/hashCode.md) &#8594; int
The hash code for this object.
_<span class="feature read-only">read-only</span><span class="feature inherited">inherited</span>_
##### [runtimeType](../package-fidl_fidl/InterfaceHandle/runtimeType.md) &#8594; Type
A representation of the runtime type of the object.
_<span class="feature read-only">read-only</span><span class="feature inherited">inherited</span>_
## 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.
_<span class="feature inherited">inherited</span>_
##### [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>.
##### [toString](../package-fidl_fidl/InterfaceHandle/toString.md)() String
A string representation of this object.
_<span class="feature inherited">inherited</span>_
## Operators
##### [operator ==](../package-fidl_fidl/InterfaceHandle/operator_equals.md)(Object other) bool
The equality operator.
_<span class="feature inherited">inherited</span>_