Skip to content

Commit

Permalink
src: lib: drivers: Require Drivers to implement Debug
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Oct 22, 2024
1 parent d2b0b50 commit bc55319
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/lib/drivers/fake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct FakeSink {
name: arc_swap::ArcSwap<String>,
uuid: DriverUuid,
Expand Down Expand Up @@ -148,6 +149,7 @@ impl DriverInfo for FakeSinkInfo {
}
}

#[derive(Debug)]
pub struct FakeSource {
name: arc_swap::ArcSwap<String>,
uuid: DriverUuid,
Expand Down
3 changes: 2 additions & 1 deletion src/lib/drivers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub struct DriverDescriptionLegacy {
}

#[async_trait::async_trait]
pub trait Driver: Send + Sync + AccumulatedDriverStatsProvider {
pub trait Driver: Send + Sync + AccumulatedDriverStatsProvider + std::fmt::Debug {
async fn run(&self, hub_sender: broadcast::Sender<Arc<Protocol>>) -> Result<()>;

fn info(&self) -> Box<dyn DriverInfo>;
Expand Down Expand Up @@ -254,6 +254,7 @@ mod tests {
}

// Example struct implementing Driver
#[derive(Debug)]
pub struct ExampleDriver {
name: arc_swap::ArcSwap<String>,
uuid: DriverUuid,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/rest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ pub struct MAVLinkMessage<T> {
pub message: T,
}

#[derive(Debug)]
pub struct Rest {
name: arc_swap::ArcSwap<String>,
uuid: DriverUuid,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/serial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct Serial {
name: arc_swap::ArcSwap<String>,
uuid: DriverUuid,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/tcp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct TcpClient {
pub remote_addr: String,
name: arc_swap::ArcSwap<String>,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/tcp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct TcpServer {
pub local_addr: String,
name: arc_swap::ArcSwap<String>,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/tlog/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct TlogReader {
pub path: PathBuf,
name: arc_swap::ArcSwap<String>,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/tlog/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct TlogWriter {
pub path: PathBuf,
name: arc_swap::ArcSwap<String>,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/udp/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct UdpClient {
pub remote_addr: String,
name: arc_swap::ArcSwap<String>,
Expand Down
1 change: 1 addition & 0 deletions src/lib/drivers/udp/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use crate::{
},
};

#[derive(Debug)]
pub struct UdpServer {
pub local_addr: String,
name: arc_swap::ArcSwap<String>,
Expand Down

0 comments on commit bc55319

Please sign in to comment.