pub struct FileSystem<'a> { /* private fields */ }
Implementations§
Source§impl<'a> FileSystem<'a>
impl<'a> FileSystem<'a>
pub fn from_raw(fs: *mut PedFileSystem) -> FileSystem<'a>
pub fn checked(&self) -> bool
pub fn geom(&mut self) -> Geometry<'_>
pub fn type_(&mut self) -> FileSystemType<'_>
Sourcepub fn open(geom: &'a Geometry<'_>) -> Option<FileSystem<'a>>
pub fn open(geom: &'a Geometry<'_>) -> Option<FileSystem<'a>>
Opens the file system stored on geom
, if it can find one.
§Examples
let mut fs = FileSystem::open(&mut geometry);
let mut fs = geometry.open_fs();
§Throws
PED_EXCEPTION_ERROR
if the file system could not be detected.PED_EXCEPTION_ERROR
if the file system is bigger than its volume.PED_EXCEPTION_NO_FEATURE
if opening of a file system stored ongeom
is not implemented.
§Note
This actually calls Geometry::open_fs
Sourcepub fn probe(geom: &'a Geometry<'_>) -> Result<FileSystemType<'a>>
pub fn probe(geom: &'a Geometry<'_>) -> Result<FileSystemType<'a>>
Attempt to detect a file system in region geom
.
This function tries to be clever at dealing with ambiguous situations, such as when one file system was not completely erased before a new file system was created on on top of it.
§Note
This actually calls geom.probe_fs()
.
Sourcepub fn probe_specific(
geom: &'a Geometry<'_>,
fs_type: &'a FileSystemType<'_>,
) -> Option<Geometry<'a>>
pub fn probe_specific( geom: &'a Geometry<'_>, fs_type: &'a FileSystemType<'_>, ) -> Option<Geometry<'a>>
Attempt to find a file system and return the region it occupies.
§Note
This actually calls geom.probe_specific_fs(fs_type)
Sourcepub fn resize(
&mut self,
geom: &Geometry<'_>,
timer: Option<&mut Timer<'_>>,
) -> Result<()>
pub fn resize( &mut self, geom: &Geometry<'_>, timer: Option<&mut Timer<'_>>, ) -> Result<()>
Resize the file system to a new geometry.
§Note
geom
should satisfy the FileSystem::get_resize_constraint()
. This isn’t
asserted, so it’s not a bug not to, but is is likely to fail.
If timer
is not None
, it will be used as the progress meter.
§Throws
Throws PED_EXCEPTION_NO_FEATURE
if resizing of the file system is not implemented yet.