onerom_protocol/lib.rs
1//! One ROM Protocol
2
3// Copyright (c) 2025 Piers Finlayson <piers@piers.rocks>
4//
5// MIT licence
6
7#![no_std]
8
9extern crate alloc;
10
11use onerom_database::Error as DbError;
12
13pub mod lab;
14
15#[derive(Debug, Clone, PartialEq, Eq)]
16pub enum Error {
17 /// Buffer too small for the data
18 BufferTooSmall,
19 /// Response was not as expected
20 InvalidResponse,
21 /// Invalid data received
22 InvalidData,
23 /// No ROM detected
24 NoRom,
25 /// ROM not recognised
26 RomNotRecognised,
27}
28
29impl From<DbError> for Error {
30 fn from(err: DbError) -> Self {
31 match err {
32 DbError::ParseError => Error::InvalidData,
33 }
34 }
35}