pub struct SourceSynchronousProxy { /* private fields */ }Implementations§
Source§impl SourceSynchronousProxy
impl SourceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<SourceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<SourceEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn get_spec(
&self,
___deadline: MonotonicInstant,
) -> Result<SourceGetSpecResult, Error>
pub fn get_spec( &self, ___deadline: MonotonicInstant, ) -> Result<SourceGetSpecResult, Error>
Returns static hardware characteristics that do not change during operation.
Sourcepub fn get_status(
&self,
___deadline: MonotonicInstant,
) -> Result<SourceGetStatusResult, Error>
pub fn get_status( &self, ___deadline: MonotonicInstant, ) -> Result<SourceGetStatusResult, Error>
Returns dynamic status of the source immediately.
Sourcepub fn set_role(
&self,
role: &Role,
___deadline: MonotonicInstant,
) -> Result<SourceSetRoleResult, Error>
pub fn set_role( &self, role: &Role, ___deadline: MonotonicInstant, ) -> Result<SourceSetRoleResult, Error>
Set the role of this specific node.
Errors:
INVALID_ARGS: If the provided role is invalid.NOT_SUPPORTED: If the requested role is not supported by the hardware.INTERNAL: If an unexpected error occurred.
Sourcepub fn watch(
&self,
interest: &Status,
wake_on: &Status,
lease: Option<EventPair>,
___deadline: MonotonicInstant,
) -> Result<(Status, Option<EventPair>), Error>
pub fn watch( &self, interest: &Status, wake_on: &Status, lease: Option<EventPair>, ___deadline: MonotonicInstant, ) -> Result<(Status, Option<EventPair>), Error>
Change notification for power source state using a “hanging-get” pattern.
The first call to this method returns the current hardware state immediately. Subsequent calls block until a change occurs that matches the provided masks.
At most one Watch call may be outstanding at a time per connection.
Completing a call acknowledges that the client has received the previous update.
§Power Management and Suspend
To prevent lost wakeups, the server (driver) must ensure that the Watch call
remains active (and hardware interrupts armed) while the system is suspended.
- Interest Triggers: If a change in the
interestmask occurs while the system is suspended, the server MUST NOT complete theWatchcall until the system wakes for another reason (e.g., awake_onevent or external trigger). This ensures the CPU remains asleep for non-critical updates. - Wake-On Triggers: If a change in the
wake_onmask occurs, the server MUST wake the system and complete the call immediately with awake_lease.
As a result of this queuing behavior, if multiple changes occur while the
system is suspended, they may be merged into a single returned status table,
and intermediate state transitions may be lost.
interest: The client wants to be notified if any of the fields present in this table change. If any field ininterestchanges, the method returns.wake_on: Similar tointerest, but if a change occurs in these fields, the server will attempt to keep the system awake using the providedlease(or by returning awake_lease) until the client acknowledges the update.lease: A power lease token used to coordinate handoff between the server and client, ensuring the system does not suspend before the client can process a critical power event.
Returns:
status: The updated status table containing the fields that changed.wake_lease: An optional lease token provided if the change triggered awake_oncondition and the server is maintaining system state.
Trait Implementations§
Source§impl Debug for SourceSynchronousProxy
impl Debug for SourceSynchronousProxy
Source§impl From<Channel> for SourceSynchronousProxy
Available on Fuchsia only.
impl From<Channel> for SourceSynchronousProxy
Source§impl From<SourceSynchronousProxy> for NullableHandle
Available on Fuchsia only.
impl From<SourceSynchronousProxy> for NullableHandle
Source§fn from(value: SourceSynchronousProxy) -> Self
fn from(value: SourceSynchronousProxy) -> Self
Source§impl FromClient for SourceSynchronousProxy
Available on Fuchsia only.
impl FromClient for SourceSynchronousProxy
Source§type Protocol = SourceMarker
type Protocol = SourceMarker
Source§fn from_client(value: ClientEnd<SourceMarker>) -> Self
fn from_client(value: ClientEnd<SourceMarker>) -> Self
Source§impl SynchronousProxy for SourceSynchronousProxy
Available on Fuchsia only.
impl SynchronousProxy for SourceSynchronousProxy
Source§type Proxy = SourceProxy
type Proxy = SourceProxy
Source§type Protocol = SourceMarker
type Protocol = SourceMarker
Proxy controls.