Skip to main content

Crate announce_core

Crate announce_core 

Source
Expand description

The implementation behind #[announce], as plain functions, and the helpers for callbacks and checks. Do not depend on this crate: go through announce, which re-exports the public API as announce::machinery and announce::helper.

A proc-macro crate cannot export functions, so the code behind the macros lives here, in an ordinary library. announce-macros is a thin wrapper around it. The crate name and layout are not a stable interface.

The API of the generation is announce() and Options (announce::machinery). See their docs, and announce::machinery for how a library uses them. helper is what callbacks and checks use (announce::helper): the parser of the tokens a trampoline sends, and the functions helper::callback() and helper::transformer().

Modules§

helper
Helpers for proc-macro crates that use announce trampolines: announce::helper.

Structs§

Check
One check or meta entry of the attribute: path or path(args).
Options
The parsed arguments of #[announce(..)].

Enums§

Layout
How the generated trampoline holds the item (layout = .., advanced).

Constants§

SINGLE_COPY_THRESHOLD
Tokens (delimiters of a group counted) from which layout = auto holds the item once (Layout::Single) instead of copying it into each arm (Layout::Direct), counted on the escaped payload plus META.

Functions§

announce
Does what #[announce(attr)] does to item.
define_repeater
Does what define_repeater!($vis $ident) does: the definition of the repeater trait, as type-leak writes it (type_leak::repeater_definition).
finish
What the hidden macro finish! of the announce crate does: the end of the attribute query that #[announce(check, ..)] sends through its checks (see crate::helper::attrs for the protocol).
try_announce
announce() with the error returned as a syn::Error.
try_define_repeater
define_repeater() with the error returned as a syn::Error.
try_finish
finish() with the error returned as a syn::Error.