Skip to content

Commit

Permalink
Derive common traits for public types
Browse files Browse the repository at this point in the history
  • Loading branch information
eldruin committed Feb 5, 2025
1 parent 594860e commit eaba606
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- Derived common traits for public types.

## [v0.6.0] - 2023-08-03

- Hide nix from the public api such that it can be updated without resulting in a breaking change.
Expand Down
2 changes: 2 additions & 0 deletions src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ use std::path::Path;
pub use core::I2CMessage;

/// Concrete linux I2C device
#[derive(Debug)]
pub struct LinuxI2CDevice {
devfile: File,
slave_address: u16,
pec: bool,
}

/// Linux I2C bus
#[derive(Debug)]
pub struct LinuxI2CBus {
devfile: File,
}
Expand Down
3 changes: 2 additions & 1 deletion src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::io;
pub type I2CResult<T> = io::Result<T>;

/// Mock I2C device register map
#[derive(Debug, Clone, Copy)]
pub struct I2CRegisterMap {
registers: [u8; 0xFF],
offset: usize,
Expand Down Expand Up @@ -61,7 +62,7 @@ impl I2CRegisterMap {
}

/// Mock I2C device exposing a register map
#[derive(Default)]
#[derive(Default, Debug, Clone, Copy)]
pub struct MockI2CDevice {
/// I2C register map
pub regmap: I2CRegisterMap,
Expand Down

0 comments on commit eaba606

Please sign in to comment.