pub fn contents(&self) -> Result<Vec<Public>> {
		let mut public_keys: Vec<Public> = self.additional.keys().cloned().collect();
		for entry in fs::read_dir(&self.path)? {
			let entry = entry?;
			let path = entry.path();

			// skip directories and non-unicode file names (hex is unicode)
			if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
				if name.len() != 64 { continue }

				match hex::decode(name) {
					Ok(ref hex) if hex.len() == 32 => {
						let mut buf = [0; 32];
						buf.copy_from_slice(&hex[..]);

						public_keys.push(Public(buf));
					}
					_ => continue,
				}
			}
		}

		Ok(public_keys)
	}
/// Get public keys of all stored keys.
Get public keys of all stored keys.
Get public keys of all stored keys .
pub fn contents(&self) -> Result<Vec<Public>> {
		let mut public_keys: Vec<Public> = self.additional.keys().cloned().collect();
		for entry in fs::read_dir(&self.path)? {
			let entry = entry?;
			let path = entry.path();
			// skip directories and non-unicode file names (hex is unicode)
			if let Some(name) = path.file_name().and_then(|n| n.to_str()) {
				if name.len() != 64 { continue }
				match hex::decode(name) {
					Ok(ref hex) if hex.len() == 32 => {
						let mut buf = [0; 32];
						buf.copy_from_slice(&hex[..]);
						public_keys.push(Public(buf));
					}
					_ => continue,
				}
			}
		}
		Ok(public_keys)
	}
pub fn contents ( & self ) -> Result < Vec < Public > > { let mut public_keys : Vec < Public > = self . additional . keys ( ) . cloned ( ) . collect ( ) ; for entry in fs :: read_dir ( & self . path ) ? { let entry = entry ? ; let path = entry . path ( ) ; // skip directories and non-unicode file names (hex is unicode) if let Some ( name ) = path . file_name ( ) . and_then ( | n | n . to_str ( ) ) { if name . len ( ) != 64 { continue } match hex :: decode ( name ) { Ok ( ref hex ) if hex . len ( ) == 32 => { let mut buf = [ 0 ; 32 ] ; buf . copy_from_slice ( & hex [ .. ] ) ; public_keys . push ( Public ( buf ) ) ; } _ => continue , } } } Ok ( public_keys ) }
Get public keys of all stored keys.
Get public keys of all stored keys .
&self
&self