[][src]Enum yy_boss::cli::input::VfsCommand

pub enum VfsCommand {
    MoveResource {
        resource_to_move: String,
        resource: Resource,
        new_parent: ViewPath,
    },
    CreateFolder {
        parent_folder: ViewPathLocation,
        folder_name: String,
    },
    MoveFolder {
        folder: ViewPathLocation,
        new_parent: ViewPathLocation,
    },
    RemoveFolder {
        folder: ViewPathLocation,
        recursive: bool,
    },
    RenameFolder {
        folder: ViewPathLocation,
        new_name: String,
    },
    GetFolder {
        folder: ViewPathLocation,
    },
    GetFullVfs,
    GetPathType {
        path: ViewPath,
    },
}

The Virtual File System command type to run.

Variants

MoveResource

An instruction to move a Resource from one location to another.

Errors

If the resource_to_move field is not set to a valid resource, or if new_parent is not set to a valid folder, this command aborts and returns an error.

Fields of MoveResource

resource_to_move: String

The name of the Resource to move.

resource: Resource

The kind of the Resource to move.

new_parent: ViewPath

The new parent of the Resource, which must be a folder.

CreateFolder

An instruction to create a Folder under the specified folder path.

Errors

If the parent_folder field is not set to a valid folder, or if folder_name is not a unique child of parent_folder, this command aborts and returns an error.

Fields of CreateFolder

parent_folder: ViewPathLocation

The identity of the Parent to add a folder to.

folder_name: String

The name of the new folder to create.

MoveFolder

An instruction to move a Folder from one location to another, along with the resources within it.

Errors

If the folder_to_move or new_parent fields are not set to a valid folder, this command aborts and returns an error. If new_parent is a folder within folder_to_move, this command will abort and return a error.

Fields of MoveFolder

folder: ViewPathLocation

The location of the Resource to move.

new_parent: ViewPathLocation

The new parent of the Resource, which must be a folder.

RemoveFolder

Deletes a folder.

If the folder is not empty, then the recursive flag must be passed -- otherwise, this command will abort.

Fields of RemoveFolder

folder: ViewPathLocation

The location of the Folder to remove.

recursive: bool

If the folder is not empty, and this flag is not set to true, then the command will abort with an error.

Since the YypBoss is modeled as a black box, there is no notion of "force" -- otherwise, this command is similar to rm -rf on Unix systems.

RenameFolder

Renames a folder.

Fields of RenameFolder

folder: ViewPathLocation

The location of the Folder to rename.

new_name: String

The new name of the Folder.

GetFolder

Returns a [FolderGraph] for this folder.

Errors

If the ViewPathLocation provided does not describe a valid Folder, this command aborts and returns an error.

Fields of GetFolder

folder: ViewPathLocation
GetFullVfs

Returns a [FolderGraph] for the entire Virtual File System. Please note, this can result in a fairly massive Json being sent back.

Errors

This command is infallible.

GetPathType

Returns an enum if the given ViewPath links to a Folder or a File.

Errors

If the ViewPath provided does not describe a valid Item, this command aborts and returns an error.

Fields of GetPathType

path: ViewPath

Trait Implementations

impl Clone for VfsCommand[src]

impl Debug for VfsCommand[src]

impl<'de> Deserialize<'de> for VfsCommand[src]

impl Eq for VfsCommand[src]

impl PartialEq<VfsCommand> for VfsCommand[src]

impl Serialize for VfsCommand[src]

impl StructuralEq for VfsCommand[src]

impl StructuralPartialEq for VfsCommand[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,