pub(in crate::ifdhandler) fn load_drivers(&self) -> Result<Vec<Driver>, LoadDriverError>
	{
		let mut drivers = Vec::new();
		self.loop_over_search_path_subfolders(|folder_entry|
		{
			// eg `ifd-ccid.bundle`.
			let file_name = folder_entry.file_name();
			let path: &Path = file_name.as_ref();
			
			if let (Some(file_stem), Some(extension)) = (path.file_stem(), path.extension())
			{
				if extension.as_bytes() == b"bundle"
				{
					// eg `/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents`.
					let contents_folder_path = folder_entry.path().append("Contents");
					if contents_folder_path.is_dir()
					{
						// eg `/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist`.
						let info_plist_file = contents_folder_path.clone().append("Info.plist");
						if info_plist_file.is_file()
						{
							Self::load_probable_driver(&mut drivers, contents_folder_path, info_plist_file, file_stem)?
						}
					}
				}
			}
			Ok(())
		})?;
		
		Ok(drivers)
	}
/// Loads drivers in paths like `/usr/libexec/SmartCardServices/drivers` with the following folder structure
///
/// ```sh
/// ifd-ccid.bundle/
/// 	Contents/
/// 		Info.plist
/// 		MacOS/
/// 			libccid.dylib
/// ```
///
/// Only errors if what seems to be a driver is detected and can not be loaded.


Only errors if what seems to be a driver is detected and can not be loaded.
Only errors if what seems to be a driver is detected and can not be loaded .
pub(in crate::ifdhandler) fn load_drivers(&self) -> Result<Vec<Driver>, LoadDriverError>
	{
		let mut drivers = Vec::new();
		self.loop_over_search_path_subfolders(|folder_entry|
		{
			// eg `ifd-ccid.bundle`.
			let file_name = folder_entry.file_name();
			let path: &Path = file_name.as_ref();
			if let (Some(file_stem), Some(extension)) = (path.file_stem(), path.extension())
			{
				if extension.as_bytes() == b"bundle"
				{
					// eg `/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents`.
					let contents_folder_path = folder_entry.path().append("Contents");
					if contents_folder_path.is_dir()
					{
						// eg `/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist`.
						let info_plist_file = contents_folder_path.clone().append("Info.plist");
						if info_plist_file.is_file()
						{
							Self::load_probable_driver(&mut drivers, contents_folder_path, info_plist_file, file_stem)?
						}
					}
				}
			}
			Ok(())
		})?;
		Ok(drivers)
	}
pub ( in crate :: ifdhandler ) fn load_drivers ( & self ) -> Result < Vec < Driver > , LoadDriverError > { let mut drivers = Vec :: new ( ) ; self . loop_over_search_path_subfolders ( | folder_entry | { // eg `ifd-ccid.bundle`. let file_name = folder_entry . file_name ( ) ; let path : & Path = file_name . as_ref ( ) ; if let ( Some ( file_stem ) , Some ( extension ) ) = ( path . file_stem ( ) , path . extension ( ) ) { if extension . as_bytes ( ) == b" " { // eg `/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents`. let contents_folder_path = folder_entry . path ( ) . append ( " " ) ; if contents_folder_path . is_dir ( ) { // eg `/usr/libexec/SmartCardServices/drivers/ifd-ccid.bundle/Contents/Info.plist`. let info_plist_file = contents_folder_path . clone ( ) . append ( " " ) ; if info_plist_file . is_file ( ) { Self :: load_probable_driver ( & mut drivers , contents_folder_path , info_plist_file , file_stem ) ? } } } } Ok ( ( ) ) } ) ? ; Ok ( drivers ) }
Loads drivers in paths like `/usr/libexec/SmartCardServices/drivers` with the following folder structure
```sh
ifd-ccid.bundle
Contents
Info.plist
MacOS
libccid.dylib
```
Loads drivers in paths like ` / usr / libexec / SmartCardServices / drivers ` with the following folder structure ` ` ` sh ifd - ccid . bundle Contents Info . plist MacOS libccid . dylib ` ` `
&self
&self