Struct fidl_fuchsia_hardware_hrtimer::DeviceProxy

source ·
pub struct DeviceProxy { /* private fields */ }

Implementations§

source§

impl DeviceProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for fuchsia.hardware.hrtimer/Device.

source

pub fn take_event_stream(&self) -> DeviceEventStream

Get a Stream of events from the remote end of the protocol.

§Panics

Panics if the event stream was already taken.

source

pub fn start( &self, id: u64, resolution: &Resolution, ticks: u64, ) -> QueryResponseFut<DeviceStartResult>

Start the timer id to expire after ticks.

If ticks is 0 then the timer will expire in 0 ticks (immediately). If the timer id was already started, then the previous Start is canceled and the driver will restart the timer. Note that this may race with the expiration of the previous timer, for instance the notification process may be already started and a new Start call won’t be able to stop a notification that is already in flight. If the specified id is invalid, then this call will return INVALID_ARGS. If the specified resolution is not supported per the resolutions provided by GetProperties, then this call will return INVALID_ARGS. If the specified ticks is beyond the range supported for the timer as provided by GetProperties, then this call will return INVALID_ARGS. If the driver encounters an internal error, then this call will return INTERNAL_ERROR.

source

pub fn stop(&self, id: u64) -> QueryResponseFut<DeviceStopResult>

Stops the timer id.

Note that this may race with the expiration of the timer, for instance notification via an event set with SetEvent may be already in flight. If the specified id is invalid, then this call will return INVALID_ARGS. If the driver encounters an internal error, then this call will return INTERNAL_ERROR.

source

pub fn get_ticks_left( &self, id: u64, ) -> QueryResponseFut<DeviceGetTicksLeftResult>

Get the current time in ticks left in timer id until expiration.

If the specified id is invalid, then this call will return INVALID_ARGS.

source

pub fn set_event( &self, id: u64, event: Event, ) -> QueryResponseFut<DeviceSetEventResult>

Sets a Zircon Event to be notified of the timer expiration.

The timer expiration will be notified via the ZX_EVENT_SIGNALED signal. The client is responsible for clearing the ZX_EVENT_SIGNALED signal. Any previously event set for the specific id is replaced. Note that this may race with the event signaling from the expiration of a timer already started. To guarantee that an event is delivered upon timer expiration, this method must be called before calling Start.

If the specified id is invalid, then this call will return INVALID_ARGS. If this method is not supported for the given id, then this call will return NOT_SUPPORTED. If the driver encounters an internal error, then this call will return INTERNAL_ERROR.

source

pub fn start_and_wait( &self, id: u64, resolution: &Resolution, ticks: u64, ) -> QueryResponseFut<DeviceStartAndWaitResult>

Start the timer id to expire after ticks and waits until the timer expires with support for preventing suspension via the Power Framework.

The driver will not respond to this call (hang) until the timer has triggered. Calling Stop on the timer will abort this call and return CANCELED. Note that this may race with the expiration of the timer.

A driver supporting this call must be able to get a lease on a power element that keeps the system from suspending. This lease is returned to the client via the keep_alive LeaseControl channel field. When keep_alive is closed, then the driver lease keeping the system from suspending will be dropped. Hence, to guarantee that the system is not suspended by the Power Framework a client must either keep this keep_alive channel for as long as the system needs to not suspend, or a client must get its own lease from the Power Framework to prevent suspension before it drops keep_alive.

If the specified id is invalid, then this call will return INVALID_ARGS. If this method is not supported for the given id, then this call will return NOT_SUPPORTED. If the driver does not have a keep_alive channel to provide to the client, then this call will return BAD_STATE. If the driver encounters an internal error, then this call will return INTERNAL_ERROR.

source

pub fn start_and_wait2( &self, id: u64, resolution: &Resolution, ticks: u64, setup_keep_alive: EventPair, ) -> QueryResponseFut<DeviceStartAndWait2Result>

Start timer id and wait for it to expire after ticks ticks.

The driver will not respond to this call (hang) until the timer has triggered. Calling Stop on the timer will abort this call and return CANCELED. Note that this may race with the expiration of the timer.

This method keeps the system awake (prevents suspension) while the timer is setup using the mandatory passed-in setup_keep_alive LeaseToken. When the timer expires this method returns a second expiration_keep_alive LeaseToken to prevent suspension at the time of expiration. These keep alive wake lease tokens are provided by the Power Framework’s System Activity Governor. A driver supporting this call must be able to get expiration_keep_alive from System Activity Governor.

When expiration_keep_alive is closed, then this driver created wake lease keeping the system from suspending at the time of the timer expiration is dropped. Hence, to guarantee that the system is not suspended by the Power Framework a client must either keep this expiration_keep_alive for as long as the system needs to stay awake, or a client must get its own wake lease from the Power Framework before it drops expiration_keep_alive to prevent suspension.

Errors:

  • INVALID_ARGS: The specified id is invalid.
  • NOT_SUPPORTED: This method is not supported for the given id.
  • BAD_STATE: The driver is in a bad state, for instance it does not have an expiration_keep_alive token to provide to the client.
  • INTERNAL_ERROR: The driver encountered an internal error.
source

pub fn get_properties(&self) -> QueryResponseFut<Properties>

Get driver properties.

Trait Implementations§

source§

impl Clone for DeviceProxy

source§

fn clone(&self) -> DeviceProxy

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 Debug for DeviceProxy

source§

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

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

impl DeviceProxyInterface for DeviceProxy

§

type StartResponseFut = QueryResponseFut<Result<(), DriverError>>

source§

fn start( &self, id: u64, resolution: &Resolution, ticks: u64, ) -> Self::StartResponseFut

§

type StopResponseFut = QueryResponseFut<Result<(), DriverError>>

source§

fn stop(&self, id: u64) -> Self::StopResponseFut

§

type GetTicksLeftResponseFut = QueryResponseFut<Result<u64, DriverError>>

source§

fn get_ticks_left(&self, id: u64) -> Self::GetTicksLeftResponseFut

§

type SetEventResponseFut = QueryResponseFut<Result<(), DriverError>>

source§

fn set_event(&self, id: u64, event: Event) -> Self::SetEventResponseFut

§

type StartAndWaitResponseFut = QueryResponseFut<Result<ClientEnd<LeaseControlMarker>, DriverError>>

source§

fn start_and_wait( &self, id: u64, resolution: &Resolution, ticks: u64, ) -> Self::StartAndWaitResponseFut

§

type StartAndWait2ResponseFut = QueryResponseFut<Result<EventPair, DriverError>>

source§

fn start_and_wait2( &self, id: u64, resolution: &Resolution, ticks: u64, setup_keep_alive: EventPair, ) -> Self::StartAndWait2ResponseFut

§

type GetPropertiesResponseFut = QueryResponseFut<Properties>

source§

fn get_properties(&self) -> Self::GetPropertiesResponseFut

source§

impl Proxy for DeviceProxy

§

type Protocol = DeviceMarker

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 into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>

Attempt to convert the proxy back into a client end. Read more
§

fn is_closed(&self) -> bool

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

fn on_closed(&self) -> OnSignals<'_, Unowned<'_, Handle>>

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

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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 T
where U: From<T>,

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 = _

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 T
where 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 T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
source§

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

Performs the conversion.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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