pub struct CoordinatorProxy { /* private fields */ }

Implementations§

source§

impl CoordinatorProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for Coordinator

source

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.

source

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.

source

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.

source

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.

source

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.
source

pub fn get_topological_path( &self ) -> QueryResponseFut<CoordinatorGetTopologicalPathResult>

Returns the topological path of this device.

source

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.

source

pub fn get_metadata( &self, key: u32 ) -> QueryResponseFut<CoordinatorGetMetadataResult>

Retrieve the metadata blob associated with this device and the given key.

source

pub fn get_metadata_size( &self, key: u32 ) -> QueryResponseFut<CoordinatorGetMetadataSizeResult>

Retrieve the metadata size associated with this device and the given key.

source

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.

source

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.

source

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.

source

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

source§

fn clone(&self) -> CoordinatorProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CoordinatorProxyInterface for CoordinatorProxy

§

type AddDeviceResponseFut = QueryResponseFut<Result<u64, i32>>

source§

fn add_device( &self, args: &mut AddDeviceArgs, coordinator: ServerEnd<CoordinatorMarker>, device_controller: ClientEnd<DeviceControllerMarker>, inspect: Option<Vmo>, outgoing_dir: Option<ClientEnd<DirectoryMarker>> ) -> Self::AddDeviceResponseFut

source§

fn schedule_remove(&self, unbind_self: bool) -> Result<(), Error>

§

type ScheduleUnbindChildrenResponseFut = QueryResponseFut<Result<bool, i32>>

source§

fn schedule_unbind_children(&self) -> Self::ScheduleUnbindChildrenResponseFut

§

type BindDeviceResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn bind_device( &self, driver_url_suffix: Option<&str> ) -> Self::BindDeviceResponseFut

§

type GetTopologicalPathResponseFut = QueryResponseFut<Result<String, i32>>

source§

fn get_topological_path(&self) -> Self::GetTopologicalPathResponseFut

§

type LoadFirmwareResponseFut = QueryResponseFut<Result<(Vmo, u64), i32>>

source§

fn load_firmware( &self, driver_path: &str, fw_path: &str ) -> Self::LoadFirmwareResponseFut

§

type GetMetadataResponseFut = QueryResponseFut<Result<Vec<u8, Global>, i32>>

source§

fn get_metadata(&self, key: u32) -> Self::GetMetadataResponseFut

§

type GetMetadataSizeResponseFut = QueryResponseFut<Result<u64, i32>>

source§

fn get_metadata_size(&self, key: u32) -> Self::GetMetadataSizeResponseFut

§

type AddMetadataResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn add_metadata( &self, key: u32, data: Option<&[u8]> ) -> Self::AddMetadataResponseFut

§

type AddCompositeDeviceResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn add_composite_device( &self, name: &str, comp_desc: &mut CompositeDeviceDescriptor ) -> Self::AddCompositeDeviceResponseFut

§

type AddCompositeNodeSpecResponseFut = QueryResponseFut<Result<(), i32>>

source§

fn add_composite_node_spec( &self, name: &str, spec: &mut CompositeNodeSpecDescriptor ) -> Self::AddCompositeNodeSpecResponseFut

§

type ConnectFidlProtocolResponseFut = QueryResponseFut<Result<(), i32>>

source§

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Proxy for CoordinatorProxy

§

type Protocol = CoordinatorMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed<'a>(&'a self) -> OnSignals<'a>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more