{"id":33936553,"url":"https://github.com/wandercn/gostd_derive","last_synced_at":"2026-03-08T23:30:52.213Z","repository":{"id":62439679,"uuid":"410918916","full_name":"wandercn/gostd_derive","owner":"wandercn","description":"proc_macro_derive  library for gostd.","archived":false,"fork":false,"pushed_at":"2021-09-28T11:37:12.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-07T17:25:26.009Z","etag":null,"topics":["go-to-rust","gostd","gostd-derive","proc-macro-derive","rust-macro"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/gostd_derive","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wandercn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-27T14:30:14.000Z","updated_at":"2021-09-28T13:08:48.000Z","dependencies_parsed_at":"2022-11-01T21:52:52.415Z","dependency_job_id":null,"html_url":"https://github.com/wandercn/gostd_derive","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wandercn/gostd_derive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandercn%2Fgostd_derive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandercn%2Fgostd_derive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandercn%2Fgostd_derive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandercn%2Fgostd_derive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wandercn","download_url":"https://codeload.github.com/wandercn/gostd_derive/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wandercn%2Fgostd_derive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30276896,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go-to-rust","gostd","gostd-derive","proc-macro-derive","rust-macro"],"created_at":"2025-12-12T14:21:28.378Z","updated_at":"2026-03-08T23:30:52.186Z","avatar_url":"https://github.com/wandercn.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [gostd_derive](https://github.com/wandercn/gostd_derive)\n\n[![crates.io](https://img.shields.io/crates/v/gostd_derive.svg?color=yellow)](https://crates.io/crates/gostd_derive)\n[![Released API docs](https://docs.rs/gostd_derive/badge.svg)](https://docs.rs/gostd_derive)\n[![GPL3 licensed](https://img.shields.io/github/license/wandercn/gostd_derive.svg)](./LICENSE)\n[![Downloads of Crates.io](https://img.shields.io/crates/d/gostd_derive.svg)](https://crates.io/crates/gostd_derive)\n[![Lines of code](https://img.shields.io/tokei/lines/github/wandercn/gostd_derive.svg)](#)\n[![Build](https://img.shields.io/github/workflow/status/wandercn/gostd/Rust.svg)](#)\n[![Languages](https://img.shields.io/github/languages/top/wandercn/gostd_derive.svg)](#)\n\nproc_macro_derive library for [gostd](https://github.com/wandercn/gostd).\n\n\n## Fmt\n\n 用宏模拟实现Go中的Stringer接口。\n 在Go中printf函数，自动打印自定义实现的String方法返回内容。\n\n- 使用方法 \n\n`#[derive(Fmt)]`\n\nexample:\n```\nuse gostd_derive::Fmt;\n\n#[derive(Fmt)]\nstruct Foo{\n  name:String,\n}\n\n// 必须为附加Fmt继承宏的Struct 或者 Emun 实现String方法才能正常运行\nimpl Foo {\n\n    fn String()-\u003eString{\n        \"test\".to_string()\n    }\n}\n```\n\n- 功能逻辑\n\nFmt功能就是继承Display 并调用String()方法，在println!()实现自定义打印格式。\n\n功能的rust表示如下。\n```rust\nimpl fmt::Display for Foo {\n    fn fmt(\u0026self, f: \u0026mut fmt::Formatter\u003c'_\u003e) -\u003e fmt::Result {\n        write!(f, \"{}\", self.String())\n    }\n} \n```\n\n- 如何调试\n\n本库只使用官方的proc_macro没有办法调试。\n唯一方法，只有运行 `cargo check` 检查,不报错就没问题。\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwandercn%2Fgostd_derive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwandercn%2Fgostd_derive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwandercn%2Fgostd_derive/lists"}