rustyfit 0.5.0

This project hosts the Rust implementation for The Flexible and Interoperable Data Transfer (FIT) Protocol
Documentation
// Code generated by fitgen/main.go. DO NOT EDIT.

// Copyright 2025 The RustyFIT Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

#![allow(unused, clippy::match_single_binding)]

use std::fmt;

#[derive(Clone, Copy, PartialEq)]
pub struct Switch(pub u8);

impl Switch {
    pub const OFF: Switch = Switch(0);
    pub const ON: Switch = Switch(1);
    pub const AUTO: Switch = Switch(2);
}

impl Default for Switch {
    fn default() -> Self {
        Self(u8::MAX)
    }
}

impl fmt::Display for Switch {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.0 {
            0 => write!(f, "off"),
            1 => write!(f, "on"),
            2 => write!(f, "auto"),
            _ => write!(f, "Switch({})", self.0),
        }
    }
}

impl fmt::Debug for Switch {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self.0 {
            0 => write!(f, "Switch::OFF(0)"),
            1 => write!(f, "Switch::ON(1)"),
            2 => write!(f, "Switch::AUTO(2)"),
            _ => write!(f, "Switch({})", self.0),
        }
    }
}