#[repr(C)]
pub struct ConfigureBezelCommand { /* private fields */ }
Expand description

Configure Bezel - Command (0x54)

Four byte command that sets the colour of the bezel to a specified RGB colour. If the validator does not have a bezel that can be modified in this way, 0xF2 (Unknown command) will be returned.

Implementations§

source§

impl ConfigureBezelCommand

source

pub fn new() -> Self

Creates a new ConfigureBezelCommand message.

source

pub fn rgb(&self) -> RGB

Gets the RGB color settings.

source

pub fn set_rgb(&mut self, rgb: RGB)

Sets the RGB color settings.

source

pub fn red(&self) -> Red

Gets the Red color setting.

source

pub fn set_red(&mut self, red: Red)

Sets the Red color setting.

source

pub fn green(&self) -> Green

Gets the Green color setting.

source

pub fn set_green(&mut self, green: Green)

Sets the Green color setting.

source

pub fn blue(&self) -> Blue

Gets the Blue color setting.

source

pub fn set_blue(&mut self, blue: Blue)

Sets the Blue color setting.

source

pub fn config_storage(&self) -> BezelConfigStorage

Gets the BezelConfigStorage setting for where color configuration is stored in memory.

source

pub fn set_config_storage(&mut self, config: BezelConfigStorage)

Sets the BezelConfigStorage setting for where color configuration is stored in memory.

Trait Implementations§

source§

impl Clone for ConfigureBezelCommand

source§

fn clone(&self) -> ConfigureBezelCommand

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 CommandOps for ConfigureBezelCommand

source§

fn command(&self) -> MessageType

Gets the Command message type.
source§

fn set_command(&mut self, command: MessageType)

Sets the Command message type.
source§

impl Debug for ConfigureBezelCommand

source§

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

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

impl Default for ConfigureBezelCommand

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for ConfigureBezelCommand

source§

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

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

impl MessageOps for ConfigureBezelCommand

source§

fn buf(&self) -> &[u8]

Gets a reference to the message buffer.
source§

fn buf_mut(&mut self) -> &mut [u8]

Gets a mutable reference to the message buffer.
source§

fn message_type(&self) -> MessageType

Gets the message type.
source§

fn is_command(&self) -> bool

Gets whether the message is a command message.
source§

fn is_response(&self) -> bool

Gets whether the message is a response message.
source§

fn is_variable(&self) -> bool

Gets whether the message has a variable data length.
source§

fn len(&self) -> usize

Gets the full length of the message buffer.
source§

fn data_len(&self) -> usize

Gets the length of the data bytes in the message buffer.
source§

fn set_data_len(&mut self, len: u8)

Sets the data length field in the message buffer.
source§

fn metadata_len(&self) -> usize

Gets the length of the metadata fields in the message buffer.
source§

fn is_empty(&self) -> bool

Gets whether the message contains any data bytes.
source§

fn init(&mut self)

Common field initialization.
source§

fn stx(&self) -> u8

Gets the STX byte.
source§

fn length(&self) -> u8

Gets the data length field.
source§

fn sequence_id(&self) -> SequenceId

Gets the SequenceId field.
source§

fn set_sequence_id(&mut self, id: SequenceId)

Sets the SequenceId field.
source§

fn toggle_sequence_id(&mut self)

Toggles the SequenceFlag value of the SequenceId.
source§

fn data(&self) -> &[u8]

Gets a reference to the data field.
source§

fn data_mut(&mut self) -> &mut [u8]

Gets a mutable reference to the data field.
source§

fn set_data(&mut self, data: &[u8]) -> Result<()>

source§

fn toggle_sequence_flag(&mut self)

Toggles the value of the SequenceFlag.
source§

fn checksum(&self) -> u16

Gets the checksum from the message buffer.
source§

fn calculate_checksum(&mut self) -> u16

Calculates the CRC-16 checksum of the message.
source§

fn verify_checksum(&self) -> Result<()>

Verifies the checksum in the message buffer matches the calculated value.
source§

fn as_bytes(&mut self) -> &[u8]

Gets the message as a byte buffer. Read more
source§

fn as_bytes_mut(&mut self) -> &mut [u8]

Gets the message as a mutable byte buffer. Read more
source§

fn from_buf(&mut self, buf: &[u8]) -> Result<()>

Constructs a message from a byte buffer.
source§

impl PartialEq<ConfigureBezelCommand> for ConfigureBezelCommand

source§

fn eq(&self, other: &ConfigureBezelCommand) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&[u8]> for ConfigureBezelCommand

§

type Error = Error

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

fn try_from(val: &[u8]) -> Result<Self>

Performs the conversion.
source§

impl<const N: usize> TryFrom<[u8; N]> for ConfigureBezelCommand

§

type Error = Error

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

fn try_from(val: [u8; N]) -> Result<Self>

Performs the conversion.
source§

impl Copy for ConfigureBezelCommand

source§

impl StructuralPartialEq for ConfigureBezelCommand

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V