pub struct DeviceWatcherProxy { /* private fields */ }
Implementations§
Source§impl DeviceWatcherProxy
impl DeviceWatcherProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.camera3/DeviceWatcher.
Sourcepub fn take_event_stream(&self) -> DeviceWatcherEventStream
pub fn take_event_stream(&self) -> DeviceWatcherEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn watch_devices(
&self,
) -> QueryResponseFut<Vec<WatchDevicesEvent>, DefaultFuchsiaResourceDialect>
pub fn watch_devices( &self, ) -> QueryResponseFut<Vec<WatchDevicesEvent>, DefaultFuchsiaResourceDialect>
Returns a list of available camera IDs when it has changed from the previously returned
list of IDs, or when it is called by a client for the first time. The returned list may be
empty, indicating no cameras are available. The IDs returned to the client will remain
consistent with respect to the physical devices they represent for the duration of the
client’s connection. Events will be sorted first by event type - existing
, added
,
removed
. Within each event type range, IDs will be provided in ascending order. Events
are coalesced by the server, so a given ID will only appear once in each list of events.
Please note that it is entirely possible for the list returned to be temporarily empty even if the local camera hardware is hardwired (vs plug-in like USB). The empty list condition is temporary on such a platform.
Camera applications should tolerate an empty list returned, and attempt to retry the
WatchDevices()
call.
Sourcepub fn connect_to_device(
&self,
id: u64,
request: ServerEnd<DeviceMarker>,
) -> Result<(), Error>
pub fn connect_to_device( &self, id: u64, request: ServerEnd<DeviceMarker>, ) -> Result<(), Error>
Acquires a camera interface for the given ID. If any clients already exist for this camera, the request is closed with the ZX_ERR_ALREADY_BOUND epitaph.
Trait Implementations§
Source§impl Clone for DeviceWatcherProxy
impl Clone for DeviceWatcherProxy
Source§fn clone(&self) -> DeviceWatcherProxy
fn clone(&self) -> DeviceWatcherProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DeviceWatcherProxy
impl Debug for DeviceWatcherProxy
Source§impl DeviceWatcherProxyInterface for DeviceWatcherProxy
impl DeviceWatcherProxyInterface for DeviceWatcherProxy
type WatchDevicesResponseFut = QueryResponseFut<Vec<WatchDevicesEvent>>
fn watch_devices(&self) -> Self::WatchDevicesResponseFut
fn connect_to_device( &self, id: u64, request: ServerEnd<DeviceMarker>, ) -> Result<(), Error>
Source§impl Proxy for DeviceWatcherProxy
impl Proxy for DeviceWatcherProxy
Source§type Protocol = DeviceWatcherMarker
type Protocol = DeviceWatcherMarker
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for DeviceWatcherProxy
impl !RefUnwindSafe for DeviceWatcherProxy
impl Send for DeviceWatcherProxy
impl Sync for DeviceWatcherProxy
impl Unpin for DeviceWatcherProxy
impl !UnwindSafe for DeviceWatcherProxy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)