pub struct LightProxy { /* private fields */ }
Implementations§
Source§impl LightProxy
impl LightProxy
Sourcepub fn take_event_stream(&self) -> LightEventStream
pub fn take_event_stream(&self) -> LightEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn get_num_lights(
&self,
) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
pub fn get_num_lights( &self, ) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
Returns the total number of physical lights. This will typically be 1 for a simple LED light, but may be greater than one for an array of lights or a more complicated lighting device. The multiple lights are addressed using “index” parameter in the calls below.
Sourcepub fn get_num_light_groups(
&self,
) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
pub fn get_num_light_groups( &self, ) -> QueryResponseFut<u32, DefaultFuchsiaResourceDialect>
Returns the total number of light groups (does not count single lights). The light groups are addressed using “group_id” parameter in the calls below.
Sourcepub fn get_info(
&self,
index: u32,
) -> QueryResponseFut<LightGetInfoResult, DefaultFuchsiaResourceDialect>
pub fn get_info( &self, index: u32, ) -> QueryResponseFut<LightGetInfoResult, DefaultFuchsiaResourceDialect>
Returns info for the single light. index: Index of the light defined by board. Must be less than value returned by GetNumLights.
Sourcepub fn get_current_simple_value(
&self,
index: u32,
) -> QueryResponseFut<LightGetCurrentSimpleValueResult, DefaultFuchsiaResourceDialect>
pub fn get_current_simple_value( &self, index: u32, ) -> QueryResponseFut<LightGetCurrentSimpleValueResult, DefaultFuchsiaResourceDialect>
Returns the current value. If the light is ON, the value is True. If the light is OFF, the value is False. If the capability ‘SIMPLE’ is not supported by this light, returns NOT_SUPPORTED. Use GetInfo to check if light supports this operation. index: a number between 0 inclusive and the count received from GetNumLights.
Sourcepub fn set_simple_value(
&self,
index: u32,
value: bool,
) -> QueryResponseFut<LightSetSimpleValueResult, DefaultFuchsiaResourceDialect>
pub fn set_simple_value( &self, index: u32, value: bool, ) -> QueryResponseFut<LightSetSimpleValueResult, DefaultFuchsiaResourceDialect>
Sets the current value. Value should be set to ‘TRUE’ to turn on the light. Value should be set to ‘FALSE’ to turn off the light. If the capability ‘SIMPLE’ is not supported by this light, returns NOT_SUPPORTED. Use GetInfo to check if light supports this operation. index: a number between 0 inclusive and the count received from GetNumLights.
Sourcepub fn get_current_brightness_value(
&self,
index: u32,
) -> QueryResponseFut<LightGetCurrentBrightnessValueResult, DefaultFuchsiaResourceDialect>
pub fn get_current_brightness_value( &self, index: u32, ) -> QueryResponseFut<LightGetCurrentBrightnessValueResult, DefaultFuchsiaResourceDialect>
Returns the current brightness value (0.0 - 1.0) of the light indicated by index, where 0.0 is minimum brightness and 1.0 is maximum. If the capability ‘BRIGHTNESS’ is not supported by this light, returns NOT_SUPPORTED. Use GetInfo to check if light supports this operation. index: a number between 0 inclusive and the count received from GetNumLights.
Sourcepub fn set_brightness_value(
&self,
index: u32,
value: f64,
) -> QueryResponseFut<LightSetBrightnessValueResult, DefaultFuchsiaResourceDialect>
pub fn set_brightness_value( &self, index: u32, value: f64, ) -> QueryResponseFut<LightSetBrightnessValueResult, DefaultFuchsiaResourceDialect>
Sets the current brightness value (0.0 - 1.0), where 0.0 is minimum brightness and 1.0 is maximum. If the capability ‘BRIGHTNESS’ is not supported by this light, returns NOT_SUPPORTED. Use GetInfo to check if light supports this operation. index: a number between 0 inclusive and the count received from GetNumLights.
Sourcepub fn get_current_rgb_value(
&self,
index: u32,
) -> QueryResponseFut<LightGetCurrentRgbValueResult, DefaultFuchsiaResourceDialect>
pub fn get_current_rgb_value( &self, index: u32, ) -> QueryResponseFut<LightGetCurrentRgbValueResult, DefaultFuchsiaResourceDialect>
Returns the current RGB value for the single light. If the capability ‘RGB’ is not supported by this light, returns NOT_SUPPORTED. Use GetInfo to check if light supports this operation. index: a number between 0 inclusive and the count received from GetNumLights.
Sourcepub fn set_rgb_value(
&self,
index: u32,
value: &Rgb,
) -> QueryResponseFut<LightSetRgbValueResult, DefaultFuchsiaResourceDialect>
pub fn set_rgb_value( &self, index: u32, value: &Rgb, ) -> QueryResponseFut<LightSetRgbValueResult, DefaultFuchsiaResourceDialect>
Sets the current RGB value. If the capability ‘RGB’ is not supported by this light, returns NOT_SUPPORTED. Use GetInfo to check if light supports this operation. index: a number between 0 inclusive and the count received from GetNumLights.
Sourcepub fn get_group_info(
&self,
group_id: u32,
) -> QueryResponseFut<LightGetGroupInfoResult, DefaultFuchsiaResourceDialect>
pub fn get_group_info( &self, group_id: u32, ) -> QueryResponseFut<LightGetGroupInfoResult, DefaultFuchsiaResourceDialect>
Returns group info for the light group. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Sourcepub fn get_group_current_simple_value(
&self,
group_id: u32,
) -> QueryResponseFut<LightGetGroupCurrentSimpleValueResult, DefaultFuchsiaResourceDialect>
pub fn get_group_current_simple_value( &self, group_id: u32, ) -> QueryResponseFut<LightGetGroupCurrentSimpleValueResult, DefaultFuchsiaResourceDialect>
Returns an array of the current values.If the light is ON, the value is True. If the light is OFF, the value is False. If group_id is invalid, INVALID_INDEX will be returned. If the capability ‘SIMPLE’ is not supported by this group, returns NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Sourcepub fn set_group_simple_value(
&self,
group_id: u32,
values: &[bool],
) -> QueryResponseFut<LightSetGroupSimpleValueResult, DefaultFuchsiaResourceDialect>
pub fn set_group_simple_value( &self, group_id: u32, values: &[bool], ) -> QueryResponseFut<LightSetGroupSimpleValueResult, DefaultFuchsiaResourceDialect>
Sets the current values through the values array. Value should be set to ‘TRUE’ to turn on the light. Value should be set to ‘FALSE’ to turn off the light. If group_id is invalid, INVALID_INDEX will be returned. If the capability ‘SIMPLE’ is not supported by this group, returns NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Sourcepub fn get_group_current_brightness_value(
&self,
group_id: u32,
) -> QueryResponseFut<LightGetGroupCurrentBrightnessValueResult, DefaultFuchsiaResourceDialect>
pub fn get_group_current_brightness_value( &self, group_id: u32, ) -> QueryResponseFut<LightGetGroupCurrentBrightnessValueResult, DefaultFuchsiaResourceDialect>
Returns an array of the current brightness values (0.0 - 1.0) for the light group, where 0.0 is minimum brightness and 1.0 is maximum. If group_id is invalid, INVALID_INDEX will be returned. If the capability ‘BRIGHTNESS’ is not supported by this group, returns NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Sourcepub fn set_group_brightness_value(
&self,
group_id: u32,
values: &[f64],
) -> QueryResponseFut<LightSetGroupBrightnessValueResult, DefaultFuchsiaResourceDialect>
pub fn set_group_brightness_value( &self, group_id: u32, values: &[f64], ) -> QueryResponseFut<LightSetGroupBrightnessValueResult, DefaultFuchsiaResourceDialect>
Sets the current brightness values (0.0 - 1.0) for the light group through the values array, where 0.0 is minimum brightness and 1.0 is maximum. If group_id is invalid, INVALID_INDEX will be returned. If the capability ‘BRIGHTNESS’ is not supported by this group, returns NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Sourcepub fn get_group_current_rgb_value(
&self,
group_id: u32,
) -> QueryResponseFut<LightGetGroupCurrentRgbValueResult, DefaultFuchsiaResourceDialect>
pub fn get_group_current_rgb_value( &self, group_id: u32, ) -> QueryResponseFut<LightGetGroupCurrentRgbValueResult, DefaultFuchsiaResourceDialect>
Returns an array of the current RGB values for the light group. If group_id is invalid, INVALID_INDEX will be returned. If the capability ‘RGB’ is not supported by this group, returns NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Sourcepub fn set_group_rgb_value(
&self,
group_id: u32,
values: &[Rgb],
) -> QueryResponseFut<LightSetGroupRgbValueResult, DefaultFuchsiaResourceDialect>
pub fn set_group_rgb_value( &self, group_id: u32, values: &[Rgb], ) -> QueryResponseFut<LightSetGroupRgbValueResult, DefaultFuchsiaResourceDialect>
Sets the current RGB value for the light group. If group_id is invalid, INVALID_INDEX will be returned. If the capability ‘RGB’ is not supported by this group, returns NOT_SUPPORTED. Use GetGroupInfo to check if group supports this operation. group_id: a number between 0 inclusive and the count received from GetNumLightGroups.
Trait Implementations§
Source§impl Clone for LightProxy
impl Clone for LightProxy
Source§fn clone(&self) -> LightProxy
fn clone(&self) -> LightProxy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for LightProxy
impl Debug for LightProxy
Source§impl LightProxyInterface for LightProxy
impl LightProxyInterface for LightProxy
type GetNumLightsResponseFut = QueryResponseFut<u32>
type GetNumLightGroupsResponseFut = QueryResponseFut<u32>
type GetInfoResponseFut = QueryResponseFut<Result<Info, LightError>>
type GetCurrentSimpleValueResponseFut = QueryResponseFut<Result<bool, LightError>>
type SetSimpleValueResponseFut = QueryResponseFut<Result<(), LightError>>
type GetCurrentBrightnessValueResponseFut = QueryResponseFut<Result<f64, LightError>>
type SetBrightnessValueResponseFut = QueryResponseFut<Result<(), LightError>>
type GetCurrentRgbValueResponseFut = QueryResponseFut<Result<Rgb, LightError>>
type SetRgbValueResponseFut = QueryResponseFut<Result<(), LightError>>
type GetGroupInfoResponseFut = QueryResponseFut<Result<GroupInfo, LightError>>
type GetGroupCurrentSimpleValueResponseFut = QueryResponseFut<Result<Option<Vec<bool>>, LightError>>
type SetGroupSimpleValueResponseFut = QueryResponseFut<Result<(), LightError>>
type GetGroupCurrentBrightnessValueResponseFut = QueryResponseFut<Result<Option<Vec<f64>>, LightError>>
type SetGroupBrightnessValueResponseFut = QueryResponseFut<Result<(), LightError>>
type GetGroupCurrentRgbValueResponseFut = QueryResponseFut<Result<Option<Vec<Rgb>>, LightError>>
type SetGroupRgbValueResponseFut = QueryResponseFut<Result<(), LightError>>
fn get_num_lights(&self) -> Self::GetNumLightsResponseFut
fn get_num_light_groups(&self) -> Self::GetNumLightGroupsResponseFut
fn get_info(&self, index: u32) -> Self::GetInfoResponseFut
fn get_current_simple_value( &self, index: u32, ) -> Self::GetCurrentSimpleValueResponseFut
fn set_simple_value( &self, index: u32, value: bool, ) -> Self::SetSimpleValueResponseFut
fn get_current_brightness_value( &self, index: u32, ) -> Self::GetCurrentBrightnessValueResponseFut
fn set_brightness_value( &self, index: u32, value: f64, ) -> Self::SetBrightnessValueResponseFut
fn get_current_rgb_value( &self, index: u32, ) -> Self::GetCurrentRgbValueResponseFut
fn set_rgb_value(&self, index: u32, value: &Rgb) -> Self::SetRgbValueResponseFut
fn get_group_info(&self, group_id: u32) -> Self::GetGroupInfoResponseFut
fn get_group_current_simple_value( &self, group_id: u32, ) -> Self::GetGroupCurrentSimpleValueResponseFut
fn set_group_simple_value( &self, group_id: u32, values: &[bool], ) -> Self::SetGroupSimpleValueResponseFut
fn get_group_current_brightness_value( &self, group_id: u32, ) -> Self::GetGroupCurrentBrightnessValueResponseFut
fn set_group_brightness_value( &self, group_id: u32, values: &[f64], ) -> Self::SetGroupBrightnessValueResponseFut
fn get_group_current_rgb_value( &self, group_id: u32, ) -> Self::GetGroupCurrentRgbValueResponseFut
fn set_group_rgb_value( &self, group_id: u32, values: &[Rgb], ) -> Self::SetGroupRgbValueResponseFut
Source§impl Proxy for LightProxy
impl Proxy for LightProxy
Source§type Protocol = LightMarker
type Protocol = LightMarker
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 LightProxy
impl !RefUnwindSafe for LightProxy
impl Send for LightProxy
impl Sync for LightProxy
impl Unpin for LightProxy
impl !UnwindSafe for LightProxy
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
)