embedded_fat/filesystem/
cluster.rs#[cfg_attr(feature = "defmt-log", derive(defmt::Format))]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Ord, PartialOrd)]
pub struct ClusterId(pub(crate) u32);
impl ClusterId {
pub const INVALID: ClusterId = ClusterId(0xFFFF_FFF6);
pub const BAD: ClusterId = ClusterId(0xFFFF_FFF7);
pub const EMPTY: ClusterId = ClusterId(0x0000_0000);
pub const ROOT_DIR: ClusterId = ClusterId(0xFFFF_FFFC);
pub const END_OF_FILE: ClusterId = ClusterId(0xFFFF_FFFF);
}
impl core::ops::Add<u32> for ClusterId {
type Output = ClusterId;
fn add(self, rhs: u32) -> ClusterId {
ClusterId(self.0 + rhs)
}
}
impl core::ops::AddAssign<u32> for ClusterId {
fn add_assign(&mut self, rhs: u32) {
self.0 += rhs;
}
}