#[deserialize]Expand description
Emit an inline open() call, decoding a blob or reading from a file.
Available when the serialization feature is enabled.
Re-exported as toolkit_zero::serialization::deserialize.
-
Variable mode —
blob_exprmust be in scope; the function name becomes the binding name; the return type (required) is used as the turbofish typeTinopen::<T>(…). The function body is discarded.#[deserialize(blob)] fn config() -> Config {} // expands to: let config: Config = open::<Config>(&blob, None)?; -
File read mode — triggered by
path = "...". Reads the file first, then passes the bytes toopen::<T>. Return type still required.#[deserialize(path = "config.bin")] fn config() -> Config {}
Full documentation and examples are in the
crate-level #[deserialize] section.