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

pub enum ResourceCommandType {
    Add(NewResource),
    Remove {
        identifier: String,
    },
    Rename {
        identifier: String,
        new_name: String,
    },
    Get {
        identifier: String,
    },
    GetAssociatedData {
        identifier: String,
        force: bool,
    },
    Exists {
        identifier: String,
    },
}

The command type to run.

Variants

Adds a resource to the project.

Errors

If there is a resource by the name already, this command will abort and return an error.

Returns

If it succeeds, it will return without any extra data, like a void.

Remove

Removes and returns the resource.

Errors

If there isn't a resource by that name of the type given, it will return an error.

Returns

If this command succeeds, it will return the resource and its associated data after having removed it.

Fields of Remove

identifier: String

The name of the resource to remove.

Rename

Renames a resource.

Errors

If there isn't a resource by that name of the type given, it will return an error.

Returns

Returns a CommandOutput with no additional data on success.

Fields of Rename

identifier: Stringnew_name: String
Get

Returns a copy of a resource.

Errors

If there isn't a resource by the given name of the given type, an error will be returned.

Returns

If this command succeeds, it will return a copy of the resource. This command will not mutate any data in the project.

Fields of Get

identifier: String

The name of the resource to get.

GetAssociatedData

Returns a copy of a resource's associated data as SerializedData in a presentable form. This generally means making keys in HashMaps JSON compatible. Further engineering work is needed to clarify this.

If the associated data for a given identifier has not been loaded, it will be loaded.

Errors

If there isn't a resource by the given name of the given type, an error will be returned. If there is an error loading the resource's associated data, an error will be returned.

Returns

If this command succeeds, it will return a copy of the resource.

Fields of GetAssociatedData

identifier: String

The name of the resource to get.

force: bool

If the resource associated data should be reloaded from disc. If the associated data has not been loaded, the resource will be loaded from disc anyway, so this flag is effectively ignored.

Exists

Returns a boolean indicating if a resource of the given name and given type exists. This command is a shortcut for performance reasons over Get, since no string writing and serialization/deserialization will be required.

Errors

This command is infallible.

Returns

This command will return true if a resource of the given name and given type exists, and false otherwise.

Fields of Exists

identifier: String

The name of the resource to check if it exists.

Trait Implementations

impl Clone for ResourceCommandType[src]

impl Debug for ResourceCommandType[src]

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

impl Eq for ResourceCommandType[src]

impl PartialEq<ResourceCommandType> for ResourceCommandType[src]

impl Serialize for ResourceCommandType[src]

impl StructuralEq for ResourceCommandType[src]

impl StructuralPartialEq for ResourceCommandType[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>,