diff --git a/procfs-core/src/crypto.rs b/procfs-core/src/crypto.rs index 74aafa1..90132ad 100644 --- a/procfs-core/src/crypto.rs +++ b/procfs-core/src/crypto.rs @@ -3,8 +3,10 @@ use crate::{expect, FromBufRead, ProcError, ProcResult}; #[cfg(feature = "serde1")] use serde::{Deserialize, Serialize}; use std::{ + borrow::Borrow, collections::HashMap, convert::TryFrom, + hash::Hash, io::BufRead, iter::{once, Peekable}, str::FromStr, @@ -60,6 +62,13 @@ impl FromBufRead for CryptoTable { } } +impl CryptoTable { + pub fn get>(&self, target: &T) -> Option<&CryptoBlock> + { + self.crypto_blocks.get(target.as_ref()) + } +} + impl CryptoBlock { fn from_iter>(iter: &mut Peekable, name: &str) -> ProcResult { let driver = parse_line(iter, "driver", &name)?;