pub struct ClientConfiguratorSynchronousProxy { /* private fields */ }
Implementations§
source§impl ClientConfiguratorSynchronousProxy
impl ClientConfiguratorSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<ClientConfiguratorEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<ClientConfiguratorEvent, 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(
&self,
client_type: ClientType,
___deadline: MonotonicInstant,
) -> Result<Option<Box<ClientConfig>>, Error>
pub fn get( &self, client_type: ClientType, ___deadline: MonotonicInstant, ) -> Result<Option<Box<ClientConfig>>, Error>
Gets the power configuration for the given [ClientType
].
If there is no power configuration for client_type
then the returned
value will be absent.
client_type
specifies which [ClientType
]ClientConfig
to get
config
is the returned client-specific configuration, or an absent value ifclient_type
does not have an existing configuration
sourcepub fn set(
&self,
client_type: ClientType,
config: &ClientConfig,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn set( &self, client_type: ClientType, config: &ClientConfig, ___deadline: MonotonicInstant, ) -> Result<(), Error>
Sets the power configuration for the given [ClientType
].
This method should be used in tandem with [GetConfig
] in order to
update the existing power configuration for a given [ClientType
]
without fully overwriting it.
When the power configuration for a given [ClientType
] is changed, the
Power Manager will reevaluate current power level of that [ClientType
]
according to the new configuration. This reevaluation may result in a
new power level being sent to the connected client.
The call returns immediately after the new config has been received and validated. Actual system changes to be applied as a result of changing a client’s configuration will occur after the call has returned. Therefore, any errors that occur while updating clients according to the new system power mode are not propagated back to the caller. Instead, client updates are applied on a “best effort” basis.
If the provided config
is not valid, then no changes will be applied
and the channel will be closed. Validation will fail if a given
SystemMode
is repeated across multiple mode_match
entries contained
by the ClientConfig
.
client_type
specifies which [ClientType
]’sClientConfig
to setconfig
is theClientConfig
that will be set for [client_type
]
Trait Implementations§
source§impl SynchronousProxy for ClientConfiguratorSynchronousProxy
impl SynchronousProxy for ClientConfiguratorSynchronousProxy
§type Proxy = ClientConfiguratorProxy
type Proxy = ClientConfiguratorProxy
§type Protocol = ClientConfiguratorMarker
type Protocol = ClientConfiguratorMarker
Proxy
controls.