libellule 0.1.1

Unofficial implementation of the PRONOTE protocol
Documentation
use serde_repr::{Deserialize_repr, Serialize_repr};

use crate::error::Error;

#[derive(Debug, PartialEq, Hash, Deserialize_repr, Serialize_repr)]
#[repr(u32)]
pub enum Tab {
    Timetable = 16,
    Grades = 198,
}

impl Eq for Tab {}

impl TryFrom<u32> for Tab {
    type Error = Error;

    fn try_from(value: u32) -> Result<Tab, Error> {
        match value {
            198 => Ok(Tab::Grades),
            _ => Err(Error::UnknownTab),
        }
    }
}