| |
| |
| |
| # Agent class |
| |
| |
| |
| |
| |
| |
| *[<Null safety>](https://dart.dev/null-safety)* |
| |
| |
| |
| <p>Agent is a globally available object which simplifies common tasks that |
| agent developers will face. At a high level, it is a wrapper around the |
| <code>agent_context.fidl</code> and <code>agent.fidl</code> interface.</p> |
| |
| |
| |
| |
| ## Constructors |
| |
| [Agent](../package-fuchsia_modular_agent/Agent/Agent.md) () |
| |
| Initializes the shared <a href="../package-fuchsia_modular_agent/Agent-class.md">Agent</a> instance. _factory_ |
| |
| |
| ## Properties |
| |
| ##### [hashCode](../package-fuchsia_modular_agent/Agent/hashCode.md) → int |
| |
| |
| |
| The hash code for this object. |
| _<span class="feature">read-only</span><span class="feature">inherited</span>_ |
| |
| |
| |
| ##### [runtimeType](../package-fuchsia_modular_agent/Agent/runtimeType.md) → Type |
| |
| |
| |
| A representation of the runtime type of the object. |
| _<span class="feature">read-only</span><span class="feature">inherited</span>_ |
| |
| |
| |
| |
| |
| ## Methods |
| |
| ##### [exposeService](../package-fuchsia_modular_agent/Agent/exposeService.md)<T extends [Service](../package-fidl_fidl/Service-class.md)>(FutureOr<T> serviceImpl) void |
| |
| |
| |
| Associate <code>serviceImpl</code> to this <a href="../package-fuchsia_modular_agent/Agent-class.md">Agent</a> and exposes it to the rest of the |
| system so that it can be discovered and connected to. Notice that |
| <code>serviceImpl</code> is of type <code>FutureOr<T></code>, where <code>T</code> represents the service |
| type, to enable the ability to wait for any asynchronous operations to |
| finish before initializing and exposing the service. |
| |
| |
| |
| |
| ##### [exposeServiceProvider](../package-fuchsia_modular_agent/Agent/exposeServiceProvider.md)<T extends [Service](../package-fidl_fidl/Service-class.md)>([ServiceProvider](../package-fuchsia_modular_agent/ServiceProvider.md)<T> serviceProvider, [ServiceData](../package-fidl_fidl/ServiceData-class.md)<T> serviceData) void |
| |
| |
| |
| Similar to <code>#exposeService</code> but instead of passing the service |
| implementation directly, pass a provider function that can be invoked |
| asynchronously, when a request is received, to provide the service |
| implementation at run time. |
| |
| |
| |
| |
| ##### [noSuchMethod](../package-fuchsia_modular_agent/Agent/noSuchMethod.md)(Invocation invocation) dynamic |
| |
| |
| |
| Invoked when a non-existent method or property is accessed. |
| _<span class="feature">inherited</span>_ |
| |
| |
| |
| ##### [serve](../package-fuchsia_modular_agent/Agent/serve.md)([Outgoing](../package-fuchsia_services_services/Outgoing-class.md) outgoing) void |
| |
| |
| |
| Exposes the Agent's <code>fidl.Agent</code> instance to the Outgoing directory. In |
| other words, advertises this as an <code>fidl.Agent</code> to the rest of the system |
| via <a href="../package-fuchsia_services_services/Outgoing-class.md">Outgoing</a>. |
| |
| |
| |
| |
| ##### [toString](../package-fuchsia_modular_agent/Agent/toString.md)() String |
| |
| |
| |
| A string representation of this object. |
| _<span class="feature">inherited</span>_ |
| |
| |
| |
| |
| |
| ## Operators |
| |
| ##### [operator ==](../package-fuchsia_modular_agent/Agent/operator_equals.md)(Object other) bool |
| |
| |
| |
| The equality operator. |
| _<span class="feature">inherited</span>_ |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |