Dekirisu's Rust Themes
Publisher: DekirisuThemes in package: 3
My rust themes highlighting unsafe/async/macro functions!
My rust themes highlighting unsafe/async/macro functions!
Full workbench mockup using this variant's colors and tokenColors.
Loading...
Workbench UI color keys from the theme JSON colors map.
TextMate scopes and font styles (syntax highlighting rules).
| scope | foreground | fontStyle |
|---|---|---|
| storage.modifier.mut | — | underline |
| punctuation.brackets.attribute, meta.attribute | #6d5f41 | — |
| comment, punctuation.brackets.curly, punctuation.brackets.angle, punctuation.brackets.round, punctuation, keyword.operator.logical, keyword.operator.namespace, keyword.operator.assignment.equal, keyword.operator.access, keyword.operator.arrow, keyword.operator.key-value, entity.name.namespace, keyword.operator.range | #5a5b5e | — |
| keyword.other | #b39265 | — |
| keyword.operator.comparison, keyword.operator.math, keyword.operator.assignment, keyword.operator.question | #b37f93 | bold |
| keyword.control | #C45198 | — |
| entity.name.type.numeric, entity.name.type.primitive, variable.other.constant, constant.other.caps, entity.name.type.lifetime, keyword.operator.borrow, keyword.operator.dereference, punctuation.definition.lifetime | #DF7D3C | bold |
| constant.numeric.decimal, constant.language | #DF7D3C | — |
| entity.name.function.macro, variable.other.metavariable.name, keyword.operator.macro.dollar | #d8b543 | bold |
| variable.other.metavariable.specifier | #d8b543 | — |
| variable.other | #b6b4b2 | — |
| entity.name.type.struct | #00ccff | bold |
| variable.language.self | #13acc0 | bold |
| entity.name.type.enum | #3EE8EE | bold |
| variable.other.enummember | #3EE8EE | — |
| meta.function.call, meta.function.definition | #738bf7 | — |
| string | #00A884 | — |
export interface User {
id: string;
name: string;
role: "admin" | "member";
tags: string[];
}
/**
* Fetch user data by ID
* @param id
* @returns User object or null if ID is invalid
*/
export async function fetchUser(id: string): Promise<User | null> {
if (!id) {
return null;
}
const response = await fetch(`/api/users/${id}`, {
method: "GET",
headers: { Accept: "application/json" },
});
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
return (await response.json()) as User;
}
function greet(user: User): string {
// Simple greeting function that uses the user's name
return `Hello, ${user.name}!`;
}