Context

Struct Context 

Source
pub struct Context(/* private fields */);

Implementations§

Source§

impl Context

Source

pub const fn new() -> Self

Source

pub fn get_current_task_identifier(&self) -> TaskIdentifier

Source

pub fn insert_file( &self, task: TaskIdentifier, file: SynchronousFile, custom_file_identifier: Option<FileIdentifier>, ) -> Option<FileIdentifier>

Source

pub fn perform_operation_on_file_or_directory<FF, FD, O>( &self, file_identifier: FileIdentifier, operation_file: FF, operation_directory: FD, ) -> Option<O>
where FF: FnOnce(&mut SynchronousFile) -> O, FD: FnOnce(&mut SynchronousDirectory) -> O,

Source

pub fn perform_operation_on_file<F, O>( &self, file_identifier: FileIdentifier, operation: F, ) -> Option<O>
where F: FnOnce(&mut SynchronousFile) -> O,

Source

pub fn perform_operation_on_directory<F, O>( &self, file: FileIdentifier, operation: F, ) -> Option<O>
where F: FnOnce(&mut SynchronousDirectory) -> O,

Source

pub fn insert_directory( &self, task: TaskIdentifier, parent: Option<FileIdentifier>, path: impl AsRef<Path>, directory: SynchronousDirectory, ) -> Option<FileIdentifier>

Source

pub fn remove_directory( &self, file: FileIdentifier, ) -> Option<SynchronousDirectory>

Source

pub fn remove_file(&self, file: FileIdentifier) -> Option<SynchronousFile>

Source

pub fn resolve_path( &self, task: TaskIdentifier, directory: FileIdentifier, path: impl AsRef<Path>, ) -> Option<PathOwned>

Source

pub async fn set_task(&self, task: TaskIdentifier)

Source

pub async fn clear_task(&self)

Source

pub async fn call_abi<F, Fut, R>(&self, function: F) -> R
where F: FnOnce() -> Fut, Fut: Future<Output = R>,

Trait Implementations§

Source§

impl Default for Context

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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.