Skip to main content

M2dirYield

Enum M2dirYield 

Source
pub enum M2dirYield {
    WantsPid,
    WantsRandom {
        len: usize,
    },
    WantsFileExists(BTreeSet<M2dirPath>),
    WantsDirRead(BTreeSet<M2dirPath>),
    WantsDirCreate(BTreeSet<M2dirPath>),
    WantsDirRemove(BTreeSet<M2dirPath>),
    WantsFileRead(BTreeSet<M2dirPath>),
    WantsFileCreate(BTreeMap<M2dirPath, Vec<u8>>),
    WantsFileRemove(BTreeSet<M2dirPath>),
    WantsRename(Vec<(M2dirPath, M2dirPath)>),
}
Expand description

Standard filesystem-only Yield. Every io-m2dir coroutine picks type Yield = M2dirYield.

Each variant is paired with the matching M2dirArg variant the driver feeds back on the next resume.

Variants§

§

WantsPid

Driver must supply the current process id and feed back M2dirArg::Pid.

§

WantsRandom

Driver must supply len random bytes and feed back M2dirArg::Random.

Fields

§len: usize
§

WantsFileExists(BTreeSet<M2dirPath>)

Driver must check each path for existence as a regular file and feed back M2dirArg::FileExists.

§

WantsDirRead(BTreeSet<M2dirPath>)

Driver must list each directory’s entries and feed back M2dirArg::DirRead.

§

WantsDirCreate(BTreeSet<M2dirPath>)

Driver must create each directory (with parents) and feed back M2dirArg::DirCreate.

§

WantsDirRemove(BTreeSet<M2dirPath>)

Driver must recursively remove each directory and feed back M2dirArg::DirRemove.

§

WantsFileRead(BTreeSet<M2dirPath>)

Driver must read each file’s bytes and feed back M2dirArg::FileRead.

§

WantsFileCreate(BTreeMap<M2dirPath, Vec<u8>>)

Driver must write each (path, bytes) pair and feed back M2dirArg::FileCreate.

§

WantsFileRemove(BTreeSet<M2dirPath>)

Driver must remove each file and feed back M2dirArg::FileRemove.

§

WantsRename(Vec<(M2dirPath, M2dirPath)>)

Driver must rename each (from, to) pair and feed back M2dirArg::Rename.

Trait Implementations§

Source§

impl Debug for M2dirYield

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.