Skip to main content

Module items

Module items 

Source
Expand description

Item-level declarations: protocol modules, value types, session state and components. The macros and the collector parse them identically.

Structs§

CommandItem
CommandParam
CommandRef
A command a feature is implemented by: a protocol command such as feature, or a standard media command such as media.play.
CommandsItem
ComponentItem
A #[component] function whose body is a single ui! declaration.
EventItem
An event a module emits: fn opened(&self, path: String);
EventsItem
FeatureItem
One variant of a #[bern::features] enum.
FeaturesItem
A #[bern::features] enum: a feature contract’s features.
FieldItem
Param
PlayerField
One application player in a #[bern::players] struct.
PlayersItem
A #[bern::players] struct: media players owned by the application, shared by every window and addressed by their field names.
ProtocolArgs
Arguments of #[bern::protocol(namespace = "…", version = N)].
ProtocolItem
A #[bern::protocol] module: value types, one state struct, one command trait and an optional query trait.
QueriesItem
QueryItem
A read-only query: fn search(&self, text: String, answer: Answer<Vec<Item>>);
SessionItem
A #[bern::session] struct: typed drafts owned by a UI session.
SourceItems
Every Bern declaration found in one source file, with module paths relative to the file’s own module.
StateItem
ValueItem
An enum or record that may cross a Bern boundary.
VariantItem

Enums§

ParamKind
ValueKind

Functions§

doc_comment
is_bern_attr
True for #[name] and #[bern::name].
parse_component
parse_component_args
Parse a #[component] function (marker attribute already removed). Parse #[component] arguments: nothing, or features = Path.
parse_component_with
Parse a component whose #[component(…)] arguments were read already.
parse_features
Parse a #[bern::features] enum (marker attribute already removed).
parse_players
Parse a #[bern::players] struct (marker attribute already removed). Every field is a Player; its name is the stable player_id.
parse_protocol
Parse a protocol module (protocol attribute already removed).
parse_protocol_args
Parse protocol attribute arguments.
parse_session
Parse a #[bern::session] struct (marker attribute already removed).
parse_source_file
Collect Bern declarations from the text of one Rust source file.
parse_source_file_with_modules
parse_value
Parse an enum or struct marked as a Bern value type. The marker attribute may still be present; its pages argument is read.
parse_value_args
The arguments of a #[bern::value(…)] marker: only pages = "slot".
type_ref
Map a Rust type to Bern’s type vocabulary.