A channel over which messages from interface T can be sent.
An interface handle holds a channel 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.
To send messages over the channel, bind the interface handle to a TProxy
object using use ProxyController<T>.bind method on the proxy's
Proxy<T>.ctrl property.
Example:
InterfaceHandle<T> fooHandle = [...]
FooProxy foo = new FooProxy();
foo.ctrl.bind(fooHandle);
foo.bar();
To obtain an interface handle to send over a channel, used the
Binding<T>.wrap method on an object of type TBinding
.
Example:
class FooImpl extends Foo {
final FooBinding _binding = new FooBinding();
InterfaceHandle<T> getInterfaceHandle() => _binding.wrap(this);
@override
void bar() {
print('Received bar message.');
}
}
Constructors
InterfaceHandle (Channel _channel)
Creates an interface handle that wraps the given channel.
Properties
channel → Channel
The underlying channel messages will be sent over when the interface
handle is bound to a Proxy.
read-only
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited
Methods
close() void
Closes the underlying channel.
noSuchMethod(Invocation invocation) dynamic
Invoked when a non-existent method or property is accessed.
inherited
passChannel() Channel
Returns channel and sets channel to null
.
toString() String
A string representation of this object.
inherited
Operators
operator ==(Object other) bool
The equality operator.
inherited