doxed 0.1.1

A crate for making Rust doc strings available at runtime.
Documentation
  • Coverage
  • 100%
    3 out of 3 items documented1 out of 2 items with examples
  • Size
  • Source code size: 5.21 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 543.74 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • npmccallum/doxed
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • npmccallum

doxed

crates.io license tests lints

Doxed is a crate for making Rust doc strings available at runtime.

This crate provides a trait, Doxed, which can be derived for any type to make its doc strings available at runtime. The doc string is specified using the #[doc = "..."] attribute or, more commonly, the Rust doc comment (///).

Note that when deriving Doxed, the doc string is not modified in any way. This preserves the original formatting, including leading whitespace and line breaks. If you want to do any processing on the doc string, you can easily do so at runtime without additional derive magic.

Example

use doxed::Doxed;

/// This is an example struct.
///
/// Multiple lines are supported.
#[doc = "So are manual doc attributes."]
#[derive(Doxed)]
struct Example<'a, T>(&'a T);

assert_eq!(Example::<()>::DOX, &[
    " This is an example struct.",
    "",
    " Multiple lines are supported.",
    "So are manual doc attributes."
]);

License: Apache-2.0