mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-11-10 06:34:18 +00:00
lofty_attr: Publish
This commit is contained in:
parent
1b546700d5
commit
0e857de104
4 changed files with 13 additions and 3 deletions
|
@ -20,7 +20,7 @@ struct MyFile {
|
|||
|
||||
// Tag field requirements:
|
||||
// * Fields *must* end with "_tag" to set them apart from the others.
|
||||
// * The type of the field *must* implement `Into<Tag>`
|
||||
// * The type of the field *must* implement `TagExt`
|
||||
|
||||
|
||||
// Specify a tag type
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
[package]
|
||||
name = "lofty_attr"
|
||||
version = "0.1.0"
|
||||
version = "0.3.0"
|
||||
authors = ["Serial <69764315+Serial-ATA@users.noreply.github.com>"]
|
||||
edition = "2021"
|
||||
license = "MIT OR Apache-2.0"
|
||||
description = "Macros for Lofty"
|
||||
repository = "https://github.com/Serial-ATA/lofty-rs"
|
||||
readme = "README.md"
|
||||
include = ["src", "Cargo.toml", "../LICENSE-*"]
|
||||
|
||||
[dependencies]
|
||||
syn = { version = "1.0.95", features = ["full"] }
|
||||
|
|
1
lofty_attr/README.md
Normal file
1
lofty_attr/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
This crate provides macros for [Lofty](https://crates.io/crates/lofty).
|
|
@ -12,8 +12,11 @@ const LOFTY_FILE_TYPES: [&str; 10] = [
|
|||
"AIFF", "APE", "FLAC", "MPEG", "MP4", "Opus", "Vorbis", "Speex", "WAV", "WavPack",
|
||||
];
|
||||
|
||||
/// Creates a file usable by Lofty
|
||||
///
|
||||
/// See [here](https://github.com/Serial-ATA/lofty-rs/tree/main/examples/custom_resolver) for an example of how to use it.
|
||||
#[proc_macro_derive(LoftyFile, attributes(lofty))]
|
||||
pub fn tag(input: TokenStream) -> TokenStream {
|
||||
pub fn lofty_file(input: TokenStream) -> TokenStream {
|
||||
let input = parse_macro_input!(input as DeriveInput);
|
||||
|
||||
let mut errors = Vec::new();
|
||||
|
|
Loading…
Reference in a new issue