Skip to main content

VdirYield

Enum VdirYield 

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

Standard filesystem Yield. Every io-vdir coroutine picks type Yield = VdirYield.

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

Variants§

§

WantsRandom

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

Fields

§len: usize

Number of random bytes the driver must supply.

§

WantsFileExists(BTreeSet<VdirPath>)

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

§

WantsDirExists(BTreeSet<VdirPath>)

Driver must check each path for existence as a directory and feed back VdirReply::DirExists.

§

WantsDirRead(BTreeSet<VdirPath>)

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

§

WantsFileRead(BTreeSet<VdirPath>)

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

§

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

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

§

WantsDirCreate(BTreeSet<VdirPath>)

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

§

WantsDirRemove(BTreeSet<VdirPath>)

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

§

WantsFileRemove(BTreeSet<VdirPath>)

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

§

WantsRename(Vec<(VdirPath, VdirPath)>)

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

§

WantsCopy(Vec<(VdirPath, VdirPath)>)

Driver must copy each (from, to) pair and feed back VdirReply::Copy.

Trait Implementations§

Source§

impl Debug for VdirYield

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.