Add entry method to SignatureMap.
This commit is contained in:
parent
49f3208e7f
commit
fb222b8e82
@ -1,7 +1,7 @@
|
|||||||
//! Digital signatures and collections of signatures.
|
//! Digital signatures and collections of signatures.
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, HashSet},
|
collections::{hash_map::Entry, HashMap, HashSet},
|
||||||
error::Error as _,
|
error::Error as _,
|
||||||
fmt::{Formatter, Result as FmtResult},
|
fmt::{Formatter, Result as FmtResult},
|
||||||
};
|
};
|
||||||
@ -136,6 +136,13 @@ impl SignatureMap {
|
|||||||
Ok(self.map.insert(host, signature_set))
|
Ok(self.map.insert(host, signature_set))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Gets the given server's corresponding signature set for in-place manipulation.
|
||||||
|
pub fn entry(&mut self, server_name: &str) -> Result<Entry<Host, SignatureSet>, Error> {
|
||||||
|
let host = server_name_to_host(server_name)?;
|
||||||
|
|
||||||
|
Ok(self.map.entry(host))
|
||||||
|
}
|
||||||
|
|
||||||
/// Gets a reference to the signature set for the given server, if any.
|
/// Gets a reference to the signature set for the given server, if any.
|
||||||
///
|
///
|
||||||
/// # Parameters
|
/// # Parameters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user