pub fn resource(name: impl Into<AssetName>) -> Option<Resource>Expand description
Open a bundled resource by name for efficient random read-only access.
Returns None if the backend has no resource with that name. Takes an AssetName — pass a
generated res::assets::… constant (e.g. resource(res::assets::stations_json)) for a checked,
guaranteed-present reference, or AssetName::dynamic for a name known only at runtime.