Struct VirtualFileSystem

Source
pub struct VirtualFileSystem<'a> { /* private fields */ }
Expand description

The virtual file system.

It is a singleton.

Implementations§

Source§

impl<'a> VirtualFileSystem<'a>

Source

pub const STANDARD_INPUT_FILE_IDENTIFIER: FileIdentifier

Source

pub const STANDARD_OUTPUT_FILE_IDENTIFIER: FileIdentifier

Source

pub const STANDARD_ERROR_FILE_IDENTIFIER: FileIdentifier

Source

pub fn new( _: &'static Manager, _: &'static Manager, _: &'static Manager, root_file_system: Box<dyn FileSystemTraits>, network_socket_driver: Option<&'a dyn SocketDriver>, ) -> Result<Self>

Source

pub async fn uninitialize(&self)

Source

pub async fn mount_file_system( &self, file_system: Box<dyn FileSystemTraits>, path: impl AsRef<Path>, task: TaskIdentifier, ) -> Result<FileSystemIdentifier>

Mount a file system at a given mount point.

Source

pub async fn unmount_file_system( &self, path: impl AsRef<Path>, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn open( &self, path: &impl AsRef<Path>, flags: Flags, task: TaskIdentifier, ) -> Result<UniqueFileIdentifier>

Source

pub async fn close( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn read( &self, file: UniqueFileIdentifier, buffer: &mut [u8], task: TaskIdentifier, ) -> Result<Size>

Source

pub async fn read_line( &self, file: UniqueFileIdentifier, task: TaskIdentifier, buffer: &mut String, ) -> Result<Size>

Source

pub async fn read_to_end( &self, file: UniqueFileIdentifier, task: TaskIdentifier, buffer: &mut Vec<u8>, ) -> Result<Size>

Source

pub async fn write( &self, file: UniqueFileIdentifier, buffer: &[u8], task: TaskIdentifier, ) -> Result<Size>

Source

pub async fn set_position( &self, file: UniqueFileIdentifier, position: &Position, task: TaskIdentifier, ) -> Result<Size>

Source

pub async fn set_owner( &self, path: impl AsRef<Path>, user: Option<UserIdentifier>, group: Option<GroupIdentifier>, ) -> Result<()>

Source

pub async fn set_permissions( &self, path: impl AsRef<Path>, permissions: Permissions, ) -> Result<()>

Source

pub async fn close_all(&self, task_identifier: TaskIdentifier) -> Result<()>

Source

pub async fn mount_device( &self, task: TaskIdentifier, path: &impl AsRef<Path>, device: Device, ) -> Result<()>

Source

pub async fn mount_static_device( &self, task: TaskIdentifier, path: &'a impl AsRef<Path>, device: Device, ) -> Result<()>

Source

pub async fn create_named_pipe( &self, path: &impl AsRef<Path>, size: usize, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn create_unnamed_pipe( &self, task: TaskIdentifier, status: Status, size: usize, ) -> Result<(UniqueFileIdentifier, UniqueFileIdentifier)>

Source

pub async fn remove(&self, path: impl AsRef<Path>) -> Result<()>

Source

pub async fn transfert( &self, file: UniqueFileIdentifier, current_task: TaskIdentifier, new_task: TaskIdentifier, new_file: Option<FileIdentifier>, ) -> Result<UniqueFileIdentifier>

Source

pub async fn flush( &self, file: UniqueFileIdentifier, task_identifier: TaskIdentifier, ) -> Result<()>

Source

pub async fn get_statistics( &self, file: UniqueFileIdentifier, task_identifier: TaskIdentifier, ) -> Result<Statistics_type>

Source

pub async fn open_directory( &self, path: &impl AsRef<Path>, task: TaskIdentifier, ) -> Result<UniqueFileIdentifier>

Source

pub async fn read_directory( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<Option<Entry>>

Source

pub async fn set_position_directory( &self, file: UniqueFileIdentifier, position: Size, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn get_position_directory( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<Size>

Source

pub async fn rewind_directory( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn close_directory( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn create_directory( &self, path: &impl AsRef<Path>, task: TaskIdentifier, ) -> Result<()>

Source

pub async fn get_mode( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<Mode>

Source

pub async fn duplicate_file_identifier( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<UniqueFileIdentifier>

Source

pub async fn create_new_task_standard_io( &self, standard_in: UniqueFileIdentifier, standard_error: UniqueFileIdentifier, standard_out: UniqueFileIdentifier, current_task: TaskIdentifier, new_task: TaskIdentifier, duplicate: bool, ) -> Result<(UniqueFileIdentifier, UniqueFileIdentifier, UniqueFileIdentifier)>

Source

pub async fn is_a_terminal( &self, file: UniqueFileIdentifier, task: TaskIdentifier, ) -> Result<bool>

Source

pub async fn rename( &self, old_path: &impl AsRef<Path>, new_path: &impl AsRef<Path>, ) -> Result<()>

Source

pub async fn get_raw_device(&self, path: &impl AsRef<Path>) -> Result<Device>

Source

pub async fn get_metadata_from_path( &self, path: &impl AsRef<Path>, ) -> Result<Metadata>

Source

pub async fn get_statistics_from_path( &self, path: &impl AsRef<Path>, ) -> Result<Statistics_type>

Source

pub async fn send( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, data: &[u8], ) -> Result<()>

Source

pub async fn receive( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, data: &mut [u8], ) -> Result<usize>

Source

pub async fn send_to( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, data: &[u8], address: SockerAddress, ) -> Result<()>

Source

pub async fn receive_from( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, data: &mut [u8], ) -> Result<(usize, SockerAddress)>

Source

pub async fn bind( &self, task: TaskIdentifier, address: SockerAddress, protocol: Protocol, ) -> Result<UniqueFileIdentifier>

Source

pub async fn connect( &self, task: TaskIdentifier, address: SockerAddress, ) -> Result<UniqueFileIdentifier>

Source

pub async fn accept( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, ) -> Result<(UniqueFileIdentifier, Option<(IP, Port)>)>

Source

pub async fn set_send_timeout( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, timeout: Duration, ) -> Result<()>

Source

pub async fn set_receive_timeout( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, timeout: Duration, ) -> Result<()>

Source

pub async fn get_send_timeout( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, ) -> Result<Option<Duration>>

Source

pub async fn get_receive_timeout( &self, task: TaskIdentifier, socket: UniqueFileIdentifier, ) -> Result<Option<Duration>>

Auto Trait Implementations§

§

impl<'a> !Freeze for VirtualFileSystem<'a>

§

impl<'a> !RefUnwindSafe for VirtualFileSystem<'a>

§

impl<'a> Send for VirtualFileSystem<'a>

§

impl<'a> Sync for VirtualFileSystem<'a>

§

impl<'a> Unpin for VirtualFileSystem<'a>

§

impl<'a> !UnwindSafe for VirtualFileSystem<'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.