pub struct ADF {
pub data: Vec<u8>,
pub bitmap: Vec<bool>,
}
Fields§
§data: Vec<u8>
§bitmap: Vec<bool>
Implementations§
Source§impl ADF
impl ADF
pub fn new(size: usize, block_size: usize) -> Self
pub fn extract_metadata(&self) -> Result<ADFMetadata>
pub fn format(&mut self, disk_type: DiskType, disk_name: &str) -> Result<()>
pub fn extract_file(&self, file_name: &str) -> Result<ExtractedFile>
pub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_file(path: &str) -> Result<ADF>
pub fn get_bitmap(&self) -> &[bool]
pub fn get_bitmap_info(&self) -> BitmapInfo
pub fn get_block_status(&self, block_index: usize) -> Option<bool>
pub fn set_block_status( &mut self, block_index: usize, status: bool, ) -> Result<()>
pub fn defragment(&mut self) -> Result<()>
pub fn get_fragmentation_score(&self) -> usize
pub fn write_to_file(&self, path: &str) -> Result<()>
pub fn find_contiguous_free_blocks(&self, count: usize) -> Option<usize>
pub fn read_sector(&self, sector: usize) -> &[u8] ⓘ
pub fn write_sector(&mut self, sector: usize, data: &[u8]) -> Result<()>
pub fn read_boot_block(&self) -> &[u8] ⓘ
pub fn read_root_block(&self) -> &[u8] ⓘ
pub fn list_root_directory(&self) -> Result<Vec<FileInfo>>
pub fn list_directory( &self, block: usize, ) -> impl Iterator<Item = Result<FileInfo>> + '_
pub fn format_protection_flags(&self, flags: u32) -> String
pub fn calculate_checksum(&self, data: &[u8]) -> u32
pub fn set_block_used(&mut self, block_index: usize)
pub fn set_block_free(&mut self, block_index: usize)
pub fn update_bitmap_blocks(&mut self) -> Result<()>
pub fn initialize_bitmap(&mut self) -> Result<()>
pub fn allocate_block(&mut self) -> Result<usize>
pub fn find_free_block(&self) -> Option<usize>
pub fn read_file_contents(&self, block: usize) -> Result<Vec<u8>>
pub fn information(&self) -> Result<DiskInfo>
pub fn list(&self) -> Result<String>
pub fn to_json(&self) -> Result<String>
pub fn from_json(json: &str) -> Result<Self>
pub fn save_to_json_file(&self, path: &str) -> Result<()>
pub fn load_from_json_file(path: &str) -> Result<Self>
pub fn create_directory(&mut self, path: &str) -> Result<()>
pub fn delete_directory(&mut self, path: &str) -> Result<()>
pub fn rename_directory(&mut self, old_path: &str, new_name: &str) -> Result<()>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ADF
impl<'de> Deserialize<'de> for ADF
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ADF
impl RefUnwindSafe for ADF
impl Send for ADF
impl Sync for ADF
impl Unpin for ADF
impl UnwindSafe for ADF
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more