pub struct ControlProxy { /* private fields */ }
Implementations§
Source§impl ControlProxy
impl ControlProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.ui.brightness/Control.
Sourcepub fn take_event_stream(&self) -> ControlEventStream
pub fn take_event_stream(&self) -> ControlEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn set_auto_brightness(&self) -> Result<(), Error>
pub fn set_auto_brightness(&self) -> Result<(), Error>
Turns the auto-brightness mode on. SetManualBrightness will turn it off.
Sourcepub fn watch_auto_brightness(
&self,
) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect>
pub fn watch_auto_brightness( &self, ) -> QueryResponseFut<bool, DefaultFuchsiaResourceDialect>
Requests the current auto-brightness mode. This call implements the Hanging Get protocol.
Sourcepub fn set_manual_brightness(&self, value: f32) -> Result<(), Error>
pub fn set_manual_brightness(&self, value: f32) -> Result<(), Error>
Turns auto-brightness mode off. Used by e.g. Settings to set manual brightness using a slider Value is in the range 0.0 to 1.0 representing min to max and will be clamped if out of range.
Sourcepub fn set_manual_brightness_smooth(
&self,
value: f32,
duration: i64,
) -> Result<(), Error>
pub fn set_manual_brightness_smooth( &self, value: f32, duration: i64, ) -> Result<(), Error>
Set manual brightness specifying the duration over which the target brightness will be set.
Sourcepub fn watch_current_brightness(
&self,
) -> QueryResponseFut<f32, DefaultFuchsiaResourceDialect>
pub fn watch_current_brightness( &self, ) -> QueryResponseFut<f32, DefaultFuchsiaResourceDialect>
Gets the current brightness in the range 0.0 to 1.0. This result is valid for both manual and auto-brightness modes and is typically used to show the current brightness on a slider. This call implements the Hanging Get protocol.
Sourcepub fn set_auto_brightness_adjustment(
&self,
adjustment: f32,
) -> Result<(), Error>
pub fn set_auto_brightness_adjustment( &self, adjustment: f32, ) -> Result<(), Error>
Sets the brightness adjustment. This will change the brightness curve by the factor of the adjustment. The adjustment is in the range of -1.0 to 1.0.
Sourcepub fn watch_auto_brightness_adjustment(
&self,
) -> QueryResponseFut<f32, DefaultFuchsiaResourceDialect>
pub fn watch_auto_brightness_adjustment( &self, ) -> QueryResponseFut<f32, DefaultFuchsiaResourceDialect>
Gets the current auto brightness adjustment. This call implements the Hanging Get protocol.
Sourcepub fn set_brightness_table(&self, table: &BrightnessTable) -> Result<(), Error>
pub fn set_brightness_table(&self, table: &BrightnessTable) -> Result<(), Error>
Sets the brightness curve as a set of points. This will override the built-in brightness curve. The default brightness curve will be used if the table is empty. The connection will be closed if table errors are detected.
Sourcepub fn get_max_absolute_brightness(
&self,
) -> QueryResponseFut<ControlGetMaxAbsoluteBrightnessResult, DefaultFuchsiaResourceDialect>
pub fn get_max_absolute_brightness( &self, ) -> QueryResponseFut<ControlGetMaxAbsoluteBrightnessResult, DefaultFuchsiaResourceDialect>
Gets the maximum supported backlight brightness in nits, if known.
Trait Implementations§
Source§impl Clone for ControlProxy
impl Clone for ControlProxy
Source§fn clone(&self) -> ControlProxy
fn clone(&self) -> ControlProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl ControlProxyInterface for ControlProxy
impl ControlProxyInterface for ControlProxy
type WatchAutoBrightnessResponseFut = QueryResponseFut<bool>
type WatchCurrentBrightnessResponseFut = QueryResponseFut<f32>
type WatchAutoBrightnessAdjustmentResponseFut = QueryResponseFut<f32>
type GetMaxAbsoluteBrightnessResponseFut = QueryResponseFut<Result<f64, i32>>
fn set_auto_brightness(&self) -> Result<(), Error>
fn watch_auto_brightness(&self) -> Self::WatchAutoBrightnessResponseFut
fn set_manual_brightness(&self, value: f32) -> Result<(), Error>
fn set_manual_brightness_smooth( &self, value: f32, duration: i64, ) -> Result<(), Error>
fn watch_current_brightness(&self) -> Self::WatchCurrentBrightnessResponseFut
fn set_auto_brightness_adjustment(&self, adjustment: f32) -> Result<(), Error>
fn watch_auto_brightness_adjustment( &self, ) -> Self::WatchAutoBrightnessAdjustmentResponseFut
fn set_brightness_table(&self, table: &BrightnessTable) -> Result<(), Error>
fn get_max_absolute_brightness( &self, ) -> Self::GetMaxAbsoluteBrightnessResponseFut
Source§impl Debug for ControlProxy
impl Debug for ControlProxy
Source§impl Proxy for ControlProxy
impl Proxy for ControlProxy
Source§type Protocol = ControlMarker
type Protocol = ControlMarker
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 ControlProxy
impl !RefUnwindSafe for ControlProxy
impl Send for ControlProxy
impl Sync for ControlProxy
impl Unpin for ControlProxy
impl !UnwindSafe for ControlProxy
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
)