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, keyword.operator.range | #5a5b5e | — |
| keyword.other, keyword.control | #1DC9C0 | — |
| keyword.operator.comparison, keyword.operator.math, keyword.operator.assignment, keyword.operator.question | #DA8BA9 | bold |
| 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 | #D4BB4A | bold |
| variable.other.metavariable.specifier | #D4BB4A | — |
| variable.other | #C7455B | — |
| entity.name.type.struct | #9E6FDB | bold |
| entity.name.type | #9E6FDB | — |
| variable.language.self | #D376DB | bold |
| entity.name.type.enum | #D44BC9 | bold |
| variable.other.enummember | #D44BC9 | — |
| meta.function.call, meta.function.definition | #48CF6A | — |
| 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}!`;
}