Converts IDL names to valid Rust identifiers for bindings.
# Source: https://github.com/LadybirdBrowser/ladybird | License: BSD-2-Clause | Copyright 2018-present, the Ladybird developers
# Provided via justclaw.it.com; keep this notice with the code.
# Copyright (c) 2026-present, the Ladybird developers.
#
# SPDX-License-Identifier: BSD-2-Clause
# The Rust names of IDL identifiers, for the Rust bindings of the interfaces implemented in Rust.
from Utils.utils import title_case_to_snake_case
RUST_KEYWORDS = {
"as", "async", "await", "break", "const", "continue", "crate", "dyn", "else", "enum", "extern", "false", "fn", "for",
"if", "impl", "in", "let", "loop", "match", "mod", "move", "mut", "pub", "ref", "return", "self", "static",
"struct", "super", "trait", "true", "type", "unsafe", "use", "where", "while", "abstract", "become", "box
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key