Struct sbp::messages::solution_meta::solution_input_type::SolutionInputType
source · pub struct SolutionInputType {
pub sensor_type: u8,
pub flags: u8,
}
Expand description
Flags for a given solution input type
Metadata describing which sensors were involved in the solution. The structure is fixed no matter what the actual sensor type is. The sensor_type field tells you which sensor we are talking about. It also tells you whether the sensor data was actually used or not. The flags field, always a u8, contains the sensor-specific data. The content of flags, for each sensor type, is described in the relevant structures in this section.
Fields§
§sensor_type: u8
The type of sensor
flags: u8
Refer to each InputType description
Implementations§
source§impl SolutionInputType
impl SolutionInputType
sourcepub fn sensor_usage(&self) -> Result<SensorUsage, u8>
pub fn sensor_usage(&self) -> Result<SensorUsage, u8>
Gets the SensorUsage stored in the sensor_type
bitfield.
Returns Ok
if the bitrange contains a known SensorUsage
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of SensorUsage
were added.
sourcepub fn set_sensor_usage(&mut self, sensor_usage: SensorUsage)
pub fn set_sensor_usage(&mut self, sensor_usage: SensorUsage)
Set the bitrange corresponding to the SensorUsage of the sensor_type
bitfield.
sourcepub fn sensor_type(&self) -> Result<SensorType, u8>
pub fn sensor_type(&self) -> Result<SensorType, u8>
Gets the SensorType stored in the sensor_type
bitfield.
Returns Ok
if the bitrange contains a known SensorType
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of SensorType
were added.
sourcepub fn set_sensor_type(&mut self, sensor_type: SensorType)
pub fn set_sensor_type(&mut self, sensor_type: SensorType)
Set the bitrange corresponding to the SensorType of the sensor_type
bitfield.
Trait Implementations§
source§impl Clone for SolutionInputType
impl Clone for SolutionInputType
source§fn clone(&self) -> SolutionInputType
fn clone(&self) -> SolutionInputType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SolutionInputType
impl Debug for SolutionInputType
source§impl<'de> Deserialize<'de> for SolutionInputType
impl<'de> Deserialize<'de> for SolutionInputType
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for SolutionInputType
impl PartialEq for SolutionInputType
source§fn eq(&self, other: &SolutionInputType) -> bool
fn eq(&self, other: &SolutionInputType) -> bool
self
and other
values to be equal, and is used
by ==
.