Skip to main content

Module meta

Module meta 

Source

StructsΒ§

AppJson πŸ”’
Wrapper over T to make it a json request response
KeySchema πŸ”’
Schema describing a well-known meta key.
MetaEditForm
MetaMergeForm
UserErrorResponse
ValueInputQuery
Query params for the value-input HTMX endpoint.

EnumsΒ§

KeyType πŸ”’
The type of value expected for a well-known meta key.
MetaChange πŸ”’
A single change between the consensus and a proposal.
RequestError
Whatever can go wrong with a request

ConstantsΒ§

META_DELETE_ROUTE
META_MERGE_ROUTE
META_RESET_ROUTE
META_SET_ROUTE
META_SUBMIT_ROUTE
META_VALUE_INPUT_ROUTE

StaticsΒ§

WELL_KNOWN_KEYS πŸ”’

FunctionsΒ§

compute_changes πŸ”’
Computes an itemized list of changes between consensus and proposal.
convert_input_value πŸ”’
Converts raw form input to a serde_json::Value appropriate for the given key type.
format_value_for_display πŸ”’
Formats a meta value for human-readable display, using the key schema when available (e.g. UNIX timestamps become formatted dates).
get_consensus_map πŸ”’
Helper to fetch the current consensus as a JSON object map.
get_value_input
HTMX endpoint: returns a type-appropriate value input for the selected key (primary outerHTML swap on #add-value), plus OOB swaps for the description hint and the Set/Delete buttons.
parse_proposal πŸ”’
Parses json_content into a JSON object map, returning empty map on failure.
post_delete
post_merge
post_reset
post_set
post_submit
render
render_changes_summary πŸ”’
Renders the β€œProposed changes” summary from a list of MetaChanges.
render_consensus_summary πŸ”’
Renders an itemized summary of all key-value pairs in a meta map, formatting values using their schema when available.
render_delete_button πŸ”’
Renders the Delete button (visible) or a hidden placeholder (invisible). Uses outerHTML OOB swap when returned from the HTMX endpoint.
render_key_picker πŸ”’
Renders a dropdown picker for well-known keys (plus any extra keys from the current proposal). Picking a key copies it into the #add-key text input and triggers its HTMX change event, then resets itself to β€œβ–Ύβ€.
render_meta_edit_form
render_set_button πŸ”’
Renders the Set button. When there is no Delete button next to it, rounded-end is added so Bootstrap applies right border-radius despite the hidden placeholder that follows.
render_submissions_form πŸ”’
render_value_description πŸ”’
Renders the description hint for a well-known key (if any), including a type hint for Amount and DateTime fields whose unit labels are no longer shown inline in the input-group.
render_value_input πŸ”’
Renders the appropriate HTML input element for the given key type.

Type AliasesΒ§

RequestResult