pub struct CoordinatorProxy { /* private fields */ }
Implementations§
source§impl CoordinatorProxy
impl CoordinatorProxy
sourcepub fn take_event_stream(&self) -> CoordinatorEventStream
pub fn take_event_stream(&self) -> CoordinatorEventStream
Get a Stream of events from the remote end of the Coordinator protocol
Panics
Panics if the event stream was already taken.
sourcepub fn add_device(
&self,
args: &mut AddDeviceArgs,
coordinator: ServerEnd<CoordinatorMarker>,
device_controller: ClientEnd<DeviceControllerMarker>,
inspect: Option<Vmo>,
outgoing_dir: Option<ClientEnd<DirectoryMarker>>
) -> QueryResponseFut<CoordinatorAddDeviceResult>
pub fn add_device( &self, args: &mut AddDeviceArgs, coordinator: ServerEnd<CoordinatorMarker>, device_controller: ClientEnd<DeviceControllerMarker>, inspect: Option<Vmo>, outgoing_dir: Option<ClientEnd<DirectoryMarker>> ) -> QueryResponseFut<CoordinatorAddDeviceResult>
Record the addition of a new device that can be communicated with via device_controller
.
On success, the returned local_device_id
is the identifier assigned by devmgr.
sourcepub fn schedule_remove(&self, unbind_self: bool) -> Result<(), Error>
pub fn schedule_remove(&self, unbind_self: bool) -> Result<(), Error>
Requests the devcoordinator schedule the removal of this device,
and the unbinding of its children.
If unbind_self
is true, the unbind hook for this device will also be called.
sourcepub fn schedule_unbind_children(
&self
) -> QueryResponseFut<CoordinatorScheduleUnbindChildrenResult>
pub fn schedule_unbind_children( &self ) -> QueryResponseFut<CoordinatorScheduleUnbindChildrenResult>
Requests the devcoordinator schedule the unbinding of this device’s children.
If the device has no children, no request will be sent, and has_children
will be false.
sourcepub fn bind_device(
&self,
driver_url_suffix: Option<&str>
) -> QueryResponseFut<CoordinatorBindDeviceResult>
pub fn bind_device( &self, driver_url_suffix: Option<&str> ) -> QueryResponseFut<CoordinatorBindDeviceResult>
Attempt to bind a driver against this device.
- request
driver_url_suffix
only driver’s that match this URL suffix will try to bind to the device (e.g: “fvm.cm”). If this is null, the API will autobind.
- error
ZX_ERR_ALREADY_BOUND
if the device is already bound. - error
ZX_ERR_NOT_FOUND
no drivers were found.
sourcepub fn get_topological_path(
&self
) -> QueryResponseFut<CoordinatorGetTopologicalPathResult>
pub fn get_topological_path( &self ) -> QueryResponseFut<CoordinatorGetTopologicalPathResult>
Returns the topological path of this device.
sourcepub fn load_firmware(
&self,
driver_path: &str,
fw_path: &str
) -> QueryResponseFut<CoordinatorLoadFirmwareResult>
pub fn load_firmware( &self, driver_path: &str, fw_path: &str ) -> QueryResponseFut<CoordinatorLoadFirmwareResult>
Requests that the firmware at the given path be loaded and returned.
sourcepub fn get_metadata(
&self,
key: u32
) -> QueryResponseFut<CoordinatorGetMetadataResult>
pub fn get_metadata( &self, key: u32 ) -> QueryResponseFut<CoordinatorGetMetadataResult>
Retrieve the metadata blob associated with this device and the given key.
sourcepub fn get_metadata_size(
&self,
key: u32
) -> QueryResponseFut<CoordinatorGetMetadataSizeResult>
pub fn get_metadata_size( &self, key: u32 ) -> QueryResponseFut<CoordinatorGetMetadataSizeResult>
Retrieve the metadata size associated with this device and the given key.
sourcepub fn add_metadata(
&self,
key: u32,
data: Option<&[u8]>
) -> QueryResponseFut<CoordinatorAddMetadataResult>
pub fn add_metadata( &self, key: u32, data: Option<&[u8]> ) -> QueryResponseFut<CoordinatorAddMetadataResult>
Add metadata blob associated with this device and the given key. If the same key is specified multiple times, the new data will be ignored in favor of the data from first call with the specified key.
sourcepub fn add_composite_device(
&self,
name: &str,
comp_desc: &mut CompositeDeviceDescriptor
) -> QueryResponseFut<CoordinatorAddCompositeDeviceResult>
pub fn add_composite_device( &self, name: &str, comp_desc: &mut CompositeDeviceDescriptor ) -> QueryResponseFut<CoordinatorAddCompositeDeviceResult>
Adds the given composite device. This causes the driver manager to try to match the fragments against the existing device tree, and to monitor all new device additions in order to find the fragments as they are created.
sourcepub fn add_composite_node_spec(
&self,
name: &str,
spec: &mut CompositeNodeSpecDescriptor
) -> QueryResponseFut<CoordinatorAddCompositeNodeSpecResult>
pub fn add_composite_node_spec( &self, name: &str, spec: &mut CompositeNodeSpecDescriptor ) -> QueryResponseFut<CoordinatorAddCompositeNodeSpecResult>
Adds the given composite node spec. This causes the driver manager to add the spec to the driver index, and then try to match the parents against the node topology. All device additions will be monitored to see if they matched to the remaining unbound nodes.
sourcepub fn connect_fidl_protocol(
&self,
fragment_name: Option<&str>,
service_name: Option<&str>,
protocol_name: &str,
server: Channel
) -> QueryResponseFut<CoordinatorConnectFidlProtocolResult>
pub fn connect_fidl_protocol( &self, fragment_name: Option<&str>, service_name: Option<&str>, protocol_name: &str, server: Channel ) -> QueryResponseFut<CoordinatorConnectFidlProtocolResult>
Connects the given FIDL protocol inside of a FIDL service. Connection is completed
asynchronously due to pipelining. Returning ZX_OK
does not imply the service exists. A
two way call to the service via the retained client end of the channel pair must be issued
in order to ascertain whether the connection has been successfully established.
- |fragment_name| should be specified if the parent is a composite node.
- |service_name| should be specified if attempting to connect to a service. This will be mandatory in the future: http://fxbug.dev/107155.
- error Reports
ZX_ERR_UNAVAILABLE
if the parent (or fragment) does not have an outgoing directory. - error Reports
ZX_ERR_NOT_FOUND
if |fragment_name| is not the name of a parent. - error Reports
ZX_ERR_NOT_SUPPORTED
if |fragment_name| is specified by the device is not a composite node
Trait Implementations§
source§impl Clone for CoordinatorProxy
impl Clone for CoordinatorProxy
source§fn clone(&self) -> CoordinatorProxy
fn clone(&self) -> CoordinatorProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl CoordinatorProxyInterface for CoordinatorProxy
impl CoordinatorProxyInterface for CoordinatorProxy
type AddDeviceResponseFut = QueryResponseFut<Result<u64, i32>>
fn add_device( &self, args: &mut AddDeviceArgs, coordinator: ServerEnd<CoordinatorMarker>, device_controller: ClientEnd<DeviceControllerMarker>, inspect: Option<Vmo>, outgoing_dir: Option<ClientEnd<DirectoryMarker>> ) -> Self::AddDeviceResponseFut
fn schedule_remove(&self, unbind_self: bool) -> Result<(), Error>
type ScheduleUnbindChildrenResponseFut = QueryResponseFut<Result<bool, i32>>
fn schedule_unbind_children(&self) -> Self::ScheduleUnbindChildrenResponseFut
type BindDeviceResponseFut = QueryResponseFut<Result<(), i32>>
fn bind_device( &self, driver_url_suffix: Option<&str> ) -> Self::BindDeviceResponseFut
type GetTopologicalPathResponseFut = QueryResponseFut<Result<String, i32>>
fn get_topological_path(&self) -> Self::GetTopologicalPathResponseFut
type LoadFirmwareResponseFut = QueryResponseFut<Result<(Vmo, u64), i32>>
fn load_firmware( &self, driver_path: &str, fw_path: &str ) -> Self::LoadFirmwareResponseFut
type GetMetadataResponseFut = QueryResponseFut<Result<Vec<u8, Global>, i32>>
fn get_metadata(&self, key: u32) -> Self::GetMetadataResponseFut
type GetMetadataSizeResponseFut = QueryResponseFut<Result<u64, i32>>
fn get_metadata_size(&self, key: u32) -> Self::GetMetadataSizeResponseFut
type AddMetadataResponseFut = QueryResponseFut<Result<(), i32>>
fn add_metadata( &self, key: u32, data: Option<&[u8]> ) -> Self::AddMetadataResponseFut
type AddCompositeDeviceResponseFut = QueryResponseFut<Result<(), i32>>
fn add_composite_device( &self, name: &str, comp_desc: &mut CompositeDeviceDescriptor ) -> Self::AddCompositeDeviceResponseFut
type AddCompositeNodeSpecResponseFut = QueryResponseFut<Result<(), i32>>
fn add_composite_node_spec( &self, name: &str, spec: &mut CompositeNodeSpecDescriptor ) -> Self::AddCompositeNodeSpecResponseFut
type ConnectFidlProtocolResponseFut = QueryResponseFut<Result<(), i32>>
fn connect_fidl_protocol( &self, fragment_name: Option<&str>, service_name: Option<&str>, protocol_name: &str, server: Channel ) -> Self::ConnectFidlProtocolResponseFut
source§impl Debug for CoordinatorProxy
impl Debug for CoordinatorProxy
source§impl Proxy for CoordinatorProxy
impl Proxy for CoordinatorProxy
§type Protocol = CoordinatorMarker
type Protocol = CoordinatorMarker
Proxy
controls.