Browse Source

Add IOError variants to PerfMapError and PerfBufferError

Alessandro Decina 4 years ago
parent
commit
5d6fe8bdf4
1 changed files with 6 additions and 0 deletions
  1. 6 0
      aya/src/maps/perf_map.rs

+ 6 - 0
aya/src/maps/perf_map.rs

@@ -54,6 +54,9 @@ pub enum PerfBufferError {
 
     #[error("the buffer needs to be of at least {size} bytes")]
     MoreSpaceNeeded { size: usize },
+
+    #[error(transparent)]
+    IOError(#[from] io::Error),
 }
 
 #[derive(Debug, PartialEq)]
@@ -266,6 +269,9 @@ pub enum PerfMapError {
     #[error("perf buffer error: {0}")]
     PerfBufferError(#[from] PerfBufferError),
 
+    #[error(transparent)]
+    IOError(#[from] io::Error),
+
     #[error("bpf_map_update_elem failed: {io_error}")]
     UpdateElementError {
         #[source]