Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Flags

Moxy uses Cargo feature flags to keep optional functionality behind compile-time gates.

derive (default)

Enables all derive macros (Display, Deref, Build, Default, Get, Set, Union, Forward) and the unionize! macro. This feature is enabled by default.

[dependencies]
moxy = "0.0.4"

json

Note

serde must be added as a separate dependency — moxy does not re-export it.

Enables the json display format, which serializes structs to JSON via serde_json. Your crate must also depend on serde:

[dependencies]
moxy = { version = "0.0.4", features = ["json"] }
serde = { version = "1", features = ["derive"] }

See JSON for usage.

color

Enables ANSI truecolor output via the colored crate.

[dependencies]
moxy = { version = "0.0.4", features = ["color"] }

See Color for usage.

full

Enables both json and color:

[dependencies]
moxy = { version = "0.0.4", features = ["full"] }
serde = { version = "1", features = ["derive"] }