2023-08-12 09:23:21 -04:00
|
|
|
use std::path::{Path, PathBuf};
|
2022-12-11 20:09:19 -05:00
|
|
|
|
2023-07-22 13:16:39 -04:00
|
|
|
use crate::architecture::Architecture;
|
2022-12-11 20:09:19 -05:00
|
|
|
|
2023-07-08 14:54:42 -04:00
|
|
|
/// Generic ESP paths which can be specific to a bootloader
|
|
|
|
pub trait EspPaths<const N: usize> {
|
|
|
|
/// Build an ESP path structure out of the ESP root directory
|
2023-06-16 10:42:19 -04:00
|
|
|
fn new(esp: impl AsRef<Path>, arch: Architecture) -> Self;
|
2023-09-14 06:38:40 -04:00
|
|
|
|
2022-12-11 20:09:19 -05:00
|
|
|
/// Return the used file paths to store as garbage collection roots.
|
2023-07-08 14:54:42 -04:00
|
|
|
fn iter(&self) -> std::array::IntoIter<&PathBuf, N>;
|
2023-09-14 06:38:40 -04:00
|
|
|
|
2023-07-08 14:54:42 -04:00
|
|
|
/// Returns the path containing NixOS EFI binaries
|
|
|
|
fn nixos_path(&self) -> &Path;
|
2023-09-14 06:38:40 -04:00
|
|
|
|
2023-07-08 14:54:42 -04:00
|
|
|
/// Returns the path containing Linux EFI binaries
|
|
|
|
fn linux_path(&self) -> &Path;
|
2022-11-23 09:26:26 -05:00
|
|
|
}
|