Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Macros for accessing your type's documentation at runtime.

License

NotificationsYou must be signed in to change notification settings

cyqsimon/documented

Repository files navigation

Derive and attribute macros for accessing your type's documentation at runtime

Quick start

use documented::{Documented,DocumentedFields,DocumentedVariants};/// Trying is the first step to failure.#[derive(Documented,DocumentedFields,DocumentedVariants)]enumAlwaysPlay{/// And Kb8.#[allow(dead_code)]Kb1,/// But only if you are white.F6,}// Documentedassert_eq!(AlwaysPlay::DOCS,"Trying is the first step to failure.");// DocumentedFieldsassert_eq!(AlwaysPlay::FIELD_DOCS,["And Kb8.","But only if you are white."]);assert_eq!(AlwaysPlay::get_field_docs("Kb1"),Ok("And Kb8."));// DocumentedVariantsassert_eq!(AlwaysPlay::F6.get_variant_docs(),"But only if you are white.");

About

Macros for accessing your type's documentation at runtime.

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp