pub struct Icon {
pub mime_type: Option<String>,
pub sizes: Vec<String>,
pub src: String,
pub theme: Option<IconTheme>,
}Expand description
An optionally-sized icon that can be displayed in a user interface.
JSON schema
{
"description": "An optionally-sized icon that can be displayed in a user interface.",
"type": "object",
"required": [
"src"
],
"properties": {
"mimeType": {
"description": "Optional MIME type override if the source MIME type is missing or generic.\nFor example: \"image/png\", \"image/jpeg\", or \"image/svg+xml\".",
"type": "string"
},
"sizes": {
"description": "Optional array of strings that specify sizes at which the icon can be used.\nEach string should be in WxH format (e.g., \"48x48\", \"96x96\") or \"any\" for scalable formats like SVG.\n\nIf not provided, the client should assume that the icon can be used at any size.",
"type": "array",
"items": {
"type": "string"
}
},
"src": {
"description": "A standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a\ndata: URI with Base64-encoded image data.\n\nConsumers SHOULD takes steps to ensure URLs serving icons are from the\nsame domain as the client/server or a trusted domain.\n\nConsumers SHOULD take appropriate precautions when consuming SVGs as they can contain\nexecutable JavaScript.",
"type": "string",
"format": "uri"
},
"theme": {
"description": "Optional specifier for the theme this icon is designed for. light indicates\nthe icon is designed to be used with a light background, and dark indicates\nthe icon is designed to be used with a dark background.\n\nIf not provided, the client should assume the icon can be used with any theme.",
"type": "string",
"enum": [
"dark",
"light"
]
}
}
}Fields§
§mime_type: Option<String>Optional MIME type override if the source MIME type is missing or generic. For example: “image/png”, “image/jpeg”, or “image/svg+xml”.
sizes: Vec<String>Optional array of strings that specify sizes at which the icon can be used. Each string should be in WxH format (e.g., “48x48”, “96x96”) or “any” for scalable formats like SVG. If not provided, the client should assume that the icon can be used at any size.
src: StringA standard URI pointing to an icon resource. May be an HTTP/HTTPS URL or a data: URI with Base64-encoded image data. Consumers SHOULD takes steps to ensure URLs serving icons are from the same domain as the client/server or a trusted domain. Consumers SHOULD take appropriate precautions when consuming SVGs as they can contain executable JavaScript.
theme: Option<IconTheme>Optional specifier for the theme this icon is designed for. light indicates the icon is designed to be used with a light background, and dark indicates the icon is designed to be used with a dark background. If not provided, the client should assume the icon can be used with any theme.