Skip to content

Commit be403a5

Browse files
committed
lib: define Removables trait
Signed-off-by: Daniel Maslowski <[email protected]>
1 parent 985dbaf commit be403a5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ use me::ME;
1818
// An empty byte in a NOR flash is all-1's.
1919
pub const EMPTY: u8 = 0xff;
2020

21+
/// Common method for anything that has removable parts, such as directories.
22+
pub trait Removables {
23+
/// Get removable ranges relative to the start of a section or directory.
24+
/// The respective section/directory needs to know its own offset.
25+
fn removables(self: &Self, retention_list: &Vec<String>) -> Vec<core::ops::Range<usize>>;
26+
}
27+
2128
#[derive(Serialize, Deserialize, Clone, Debug)]
2229
pub struct Firmware {
2330
pub ifd: Result<IFD, IfdError>,

0 commit comments

Comments
 (0)