Skip to content

Prefix Attribute #2

@Shadorain

Description

@Shadorain

Summary

Add an attribute for prefixing all variant filenames.

Idea

Currently, Variant names are just lowercased and used as the filename. You can always specify a filename too on a Variant, but what if you want all filenames to be prefixed, maybe by a random string, maybe by the enum name, up to you.

use asset_derive::Asset;

#[derive(Asset)]
#[asset(prefix = "icon-")] // <-- Default for this enum, all filenames will be prefixed with `icon-`.
enum Icon {
    Select,
    Folder,
    #[asset(prefix = "icon-dim-")] // <-- This Variant will override the default prefix for itself.
    FolderDim,
}

Conclusion

It isn't that useful of a feature, but it definitely is an idea and something that could be added.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttodoFor future expansion

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions