Struct FileSystem

Source
pub struct FileSystem<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> FileSystem<'a>

Source

pub fn from_raw(fs: *mut PedFileSystem) -> FileSystem<'a>

Source

pub fn checked(&self) -> bool

Source

pub fn geom(&mut self) -> Geometry<'_>

Source

pub fn type_(&mut self) -> FileSystemType<'_>

Source

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 on geom is not implemented.
§Note

This actually calls Geometry::open_fs

Source

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().

Source

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)

Source

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.

Auto Trait Implementations§

§

impl<'a> Freeze for FileSystem<'a>

§

impl<'a> RefUnwindSafe for FileSystem<'a>

§

impl<'a> !Send for FileSystem<'a>

§

impl<'a> !Sync for FileSystem<'a>

§

impl<'a> Unpin for FileSystem<'a>

§

impl<'a> !UnwindSafe for FileSystem<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.