{"id":30052026,"url":"https://github.com/al8n/getifs","last_synced_at":"2026-04-15T06:06:59.593Z","repository":{"id":270786756,"uuid":"910766311","full_name":"al8n/getifs","owner":"al8n","description":"A bunch of cross platform network tools for fetching interfaces, multicast addresses, local ip addresses, private ip addresses, public ip addresses and etc.","archived":false,"fork":false,"pushed_at":"2025-07-29T00:29:35.000Z","size":91,"stargazers_count":21,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T09:49:54.990Z","etag":null,"topics":["getifaddrs","network-interface","network-interfaces","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/al8n.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"al8n","patreon":"al8n","ko_fi":"al8n9434"}},"created_at":"2025-01-01T11:04:04.000Z","updated_at":"2025-07-11T18:00:18.000Z","dependencies_parsed_at":"2025-01-03T05:18:21.873Z","dependency_job_id":"069c5f24-c652-4f82-9d8b-76c4b0395af1","html_url":"https://github.com/al8n/getifs","commit_stats":null,"previous_names":["al8n/getifs"],"tags_count":1,"template":false,"template_full_name":"al8n/template-rs","purl":"pkg:github/al8n/getifs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fgetifs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fgetifs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fgetifs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fgetifs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/al8n","download_url":"https://codeload.github.com/al8n/getifs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al8n%2Fgetifs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269291636,"owners_count":24392492,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-07T02:00:09.698Z","response_time":73,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["getifaddrs","network-interface","network-interfaces","rust"],"created_at":"2025-08-07T16:34:08.755Z","updated_at":"2026-04-15T06:06:59.587Z","avatar_url":"https://github.com/al8n.png","language":"Rust","funding_links":["https://github.com/sponsors/al8n","https://patreon.com/al8n","https://ko-fi.com/al8n9434"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eGetIfs\u003c/h1\u003e\n\u003c/div\u003e\n\u003cdiv align=\"center\"\u003e\n\nCross-platform enumeration of network interfaces and their MTU, gateway, multicast, and local/private/public IP addresses — with a libc-free netlink backend on Linux and no getifaddrs dependency.\n\n\n[\u003cimg alt=\"github\" src=\"https://img.shields.io/badge/github-al8n/getifs-8da0cb?style=for-the-badge\u0026logo=Github\" height=\"22\"\u003e][Github-url]\n\u003cimg alt=\"LoC\" src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fgist.githubusercontent.com%2Fal8n%2F327b2a8aef9003246e45c6e47fe63937%2Fraw%2Fgetifs\" height=\"22\"\u003e\n[\u003cimg alt=\"Build\" src=\"https://img.shields.io/github/actions/workflow/status/al8n/getifs/ci.yml?logo=Github-Actions\u0026style=for-the-badge\" height=\"22\"\u003e][CI-url]\n[\u003cimg alt=\"codecov\" src=\"https://img.shields.io/codecov/c/gh/al8n/getifs?style=for-the-badge\u0026token=6R3QFWRWHL\u0026logo=codecov\" height=\"22\"\u003e][codecov-url]\n\n[\u003cimg alt=\"docs.rs\" src=\"https://img.shields.io/badge/docs.rs-getifs-66c2a5?style=for-the-badge\u0026labelColor=555555\u0026logo=data:image/svg+xml;base64,PHN2ZyByb2xlPSJpbWciIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgdmlld0JveD0iMCAwIDUxMiA1MTIiPjxwYXRoIGZpbGw9IiNmNWY1ZjUiIGQ9Ik00ODguNiAyNTAuMkwzOTIgMjE0VjEwNS41YzAtMTUtOS4zLTI4LjQtMjMuNC0zMy43bC0xMDAtMzcuNWMtOC4xLTMuMS0xNy4xLTMuMS0yNS4zIDBsLTEwMCAzNy41Yy0xNC4xIDUuMy0yMy40IDE4LjctMjMuNCAzMy43VjIxNGwtOTYuNiAzNi4yQzkuMyAyNTUuNSAwIDI2OC45IDAgMjgzLjlWMzk0YzAgMTMuNiA3LjcgMjYuMSAxOS45IDMyLjJsMTAwIDUwYzEwLjEgNS4xIDIyLjEgNS4xIDMyLjIgMGwxMDMuOS01MiAxMDMuOSA1MmMxMC4xIDUuMSAyMi4xIDUuMSAzMi4yIDBsMTAwLTUwYzEyLjItNi4xIDE5LjktMTguNiAxOS45LTMyLjJWMjgzLjljMC0xNS05LjMtMjguNC0yMy40LTMzLjd6TTM1OCAyMTQuOGwtODUgMzEuOXYtNjguMmw4NS0zN3Y3My4zek0xNTQgMTA0LjFsMTAyLTM4LjIgMTAyIDM4LjJ2LjZsLTEwMiA0MS40LTEwMi00MS40di0uNnptODQgMjkxLjFsLTg1IDQyLjV2LTc5LjFsODUtMzguOHY3NS40em0wLTExMmwtMTAyIDQxLjQtMTAyLTQxLjR2LS42bDEwMi0zOC4yIDEwMiAzOC4ydi42em0yNDAgMTEybC04NSA0Mi41di03OS4xbDg1LTM4Ljh2NzUuNHptMC0xMTJsLTEwMiA0MS40LTEwMi00MS40di0uNmwxMDItMzguMiAxMDIgMzguMnYuNnoiPjwvcGF0aD48L3N2Zz4K\" height=\"20\"\u003e][doc-url]\n[\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/getifs?style=for-the-badge\u0026logo=data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iaXNvLTg4NTktMSI/Pg0KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPg0KPHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iMCAwIDUxMiA1MTIiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPGc+DQoJPGc+DQoJCTxwYXRoIGQ9Ik0yNTYsMEwzMS41MjgsMTEyLjIzNnYyODcuNTI4TDI1Niw1MTJsMjI0LjQ3Mi0xMTIuMjM2VjExMi4yMzZMMjU2LDB6IE0yMzQuMjc3LDQ1Mi41NjRMNzQuOTc0LDM3Mi45MTNWMTYwLjgxDQoJCQlsMTU5LjMwMyw3OS42NTFWNDUyLjU2NHogTTEwMS44MjYsMTI1LjY2MkwyNTYsNDguNTc2bDE1NC4xNzQsNzcuMDg3TDI1NiwyMDIuNzQ5TDEwMS44MjYsMTI1LjY2MnogTTQzNy4wMjYsMzcyLjkxMw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Mjg4IDM0MS4zMTIgNTcwLjI0aDEyOHpNMTAyNCA2NDAuMTI4QzEwMjQgNzgyLjkxMiA5MTkuODcyIDg5NiA3ODcuNjQ4IDg5NmgtNTEyQzEyMy45MDQgODk2IDAgNzYxLjYgMCA1OTcuNTA0IDAgNDUxLjk2OCA5NC42NTYgMzMxLjUyIDIyNi40MzIgMzAyLjk3NiAyODQuMTYgMTk1LjQ1NiAzOTEuODA4IDEyOCA1MTIgMTI4YzE1Mi4zMiAwIDI4Mi4xMTIgMTA4LjQxNiAzMjMuMzkyIDI2MS4xMkM5NDEuODg4IDQxMy40NCAxMDI0IDUxOS4wNCAxMDI0IDY0MC4xOTJ6IG0tMjU5LjItMjA1LjMxMmMtMjQuNDQ4LTEyOS4wMjQtMTI4Ljg5Ni0yMjIuNzItMjUyLjgtMjIyLjcyLTk3LjI4IDAtMTgzLjA0IDU3LjM0NC0yMjQuNjQgMTQ3LjQ1NmwtOS4yOCAyMC4yMjQtMjAuOTI4IDIuOTQ0Yy0xMDMuMzYgMTQuNC0xNzguMzY4IDEwNC4zMi0xNzguMzY4IDIxNC43MiAwIDExNy45NTIgODguODMyIDIxNC40IDE5Ni45MjggMjE0LjRoNTEyYzg4LjMyIDAgMTU3LjUwNC03NS4xMzYgMTU3LjUwNC0xNzEuNzEyIDAtODguMDY0LTY1LjkyLTE2NC45MjgtMTQ0Ljk2LTE3MS43NzZsLTI5LjUwNC0yLjU2LTUuODg4LTMwLjk3NnoiIGZpbGw9IiNmZmZmZmYiIHAtaWQ9IjM0MjIiIGRhdGEtc3BtLWFuY2hvci1pZD0iYTMxM3guNzc4MTA2OS4wLmkwIiBjbGFzcz0iIj48L3BhdGg+PC9zdmc+\u0026style=for-the-badge\" height=\"22\"\u003e][crates-url]\n\u003cimg alt=\"license\" src=\"https://img.shields.io/badge/License-Apache%202.0/MIT-blue.svg?style=for-the-badge\u0026fontColor=white\u0026logoColor=f5c076\u0026logo=data:image/svg+xml;base64,PCFET0NUWVBFIHN2Z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A0LjcyMywyNTguNzE1LDEzOC4zNTcsMjU4LjcxNXoiLz4gPHBhdGggZD0iTTE5NC43OTgsMTYwLjkwM2MtNC4xODgtMi42NzctOS43NTMtMS40NTQtMTIuNDMyLDIuNzMyYy04LjY5NCwxMy41OTMtMjMuNTAzLDIxLjcwOC0zOS42MTQsMjEuNzA4IGMtMjUuOTA4LDAtNDYuOTg1LTIxLjA3OC00Ni45ODUtNDYuOTg2czIxLjA3Ny00Ni45ODYsNDYuOTg1LTQ2Ljk4NmMxNS42MzMsMCwzMC4yLDcuNzQ3LDM4Ljk2OCwyMC43MjMgYzIuNzgyLDQuMTE3LDguMzc1LDUuMjAxLDEyLjQ5NiwyLjQxOGM0LjExOC0yLjc4Miw1LjIwMS04LjM3NywyLjQxOC0xMi40OTZjLTEyLjExOC0xNy45MzctMzIuMjYyLTI4LjY0NS01My44ODItMjguNjQ1IGMtMzUuODMzLDAtNjQuOTg1LDI5LjE1Mi02NC45ODUsNjQuOTg2czI5LjE1Miw2NC45ODYsNjQuOTg1LDY0Ljk4NmMyMi4yODEsMCw0Mi43NTktMTEuMjE4LDU0Ljc3OC0zMC4wMDkgQzIwMC4yMDgsMTY5LjE0NywxOTguOTg1LDE2My41ODIsMTk0Ljc5OCwxNjAuOTAzeiIvPiA8L2c+IDwvZz4KDTwvc3ZnPg==\" height=\"22\"\u003e\n\n\u003c/div\u003e\n\n## Installation\n\n```toml\n[dependencies]\ngetifs = \"0.5\"\n```\n\n## Features\n\n- **Zero libc dependency** on Linux (uses netlink directly)\n- **MTU information** - Get interface MTU values\n- **Multicast addresses** - Fetch multicast group memberships\n- **Gateway discovery** - Find IPv4 and IPv6 gateway addresses\n- **RFC-based filtering** - Filter addresses by RFC classification\n- **High performance** - Up to 189x faster than alternatives on macOS (see benchmarks)\n- **Cross-platform** - Linux, macOS, BSD, Windows support\n\n## Quick Start\n\n```rust\nuse getifs::{interfaces, local_addrs, gateway_addrs};\n\n// Get all network interfaces\nlet interfaces = interfaces().unwrap();\nfor interface in interfaces {\n    println!(\"Interface: {} (index: {})\", interface.name(), interface.index());\n    println!(\"  MTU: {}\", interface.mtu());\n    println!(\"  Flags: {:?}\", interface.flags());\n}\n\n// Get local IP addresses\nlet local_ips = local_addrs().unwrap();\nfor ip in local_ips {\n    println!(\"Local IP: {}\", ip);\n}\n\n// Get gateway addresses\nlet gateways = gateway_addrs().unwrap();\nfor gateway in gateways {\n    println!(\"Gateway: {}\", gateway);\n}\n```\n\n## Examples\n\n- Fetching all interfaces: [examples/interfaces.rs](./examples/interfaces.rs)\n- Fetching all interface addresses (excluding multicast addrs): [examples/addrs.rs](./examples/addrs.rs)\n- Fetching all interface multicast addresses: [examples/multicast_addrs.rs](./examples/multicast_addrs.rs)\n- Fetching gateway addresses: [examples/gateway.rs](./examples/gateway.rs)\n- Fetching local ip addresses: [examples/local_ip_addrs.rs](./examples/local_ip_addrs.rs)\n- Fetching ip addresses by RFC: [examples/filter_by_rfc.rs](./examples/filter_by_rfc.rs)\n\n## Details\n\nOS | Approach\n--- | ---\nLinux (no `libc`) | `socket(AF_NETLINK, SOCK_RAW \\| SOCK_CLOEXEC, NETLINK_ROUTE)`\nBSD-like | `sysctl`\nWindows | `GetAdaptersAddresses`\n\n## Why `getifs`?\n\nExisting network interface crates have limitations:\n\n- **Missing features**: Most don't support MTU or multicast addresses\n- **Performance overhead**: Nearly all use `libc::getifaddrs`, which is slower\n- **Unnecessary allocations**: Heavy use of heap allocations for simple queries\n\n`getifs` addresses these by:\n\n- Using platform-native APIs directly (netlink, sysctl, GetAdaptersAddresses)\n- Minimizing allocations with `SmallVec` and `SmolStr`\n- Providing comprehensive interface information including MTU and multicast support\n- Achieving **significantly better performance** than alternatives:\n  - **Up to 189x faster** on macOS (`interface_by_index`)\n  - **Up to 37x faster** on macOS (list interfaces)\n  - **2.4–2.8x faster** on Linux (interface enumeration)\n  - **~7x faster** local-IP lookup on Linux\n  - Comparable performance on Windows (`GetAdaptersAddresses` overhead dominates)\n\n## Roadmap\n\n- [ ] Support fetching routing tables\n\n## Benchmarks\n\nAll benchmarks are run with [Criterion.rs](https://github.com/bheisler/criterion.rs) on GitHub Actions. Lower is better.\n\n\u003e **Note**: Automated benchmarks run on Linux, macOS, and Windows via GitHub Actions. View the latest results in the [Actions tab](https://github.com/al8n/getifs/actions/workflows/benchmark.yml) or see [benchmark documentation](.github/BENCHMARKS.md) for more details.\n\n### Performance Summary\n\nNumbers below compare `getifs` against `network-interface 2` and\n`local-ip-address 0.6`. Each row reports median `cargo bench` time\n(Criterion, 100 samples).\n\n- **macOS (Apple M4 Pro)** — measured on a bare-metal laptop, not CI.\n  The GitHub Actions macOS runners are shared virtual machines with\n  highly variable latency (run-to-run wobble of ±30% on these ops),\n  which obscures the real cost difference.\n- **Linux (x64) / Windows (x64)** — measured on GitHub Actions\n  `ubuntu-latest` / `windows-latest` runners on 2026-04-15 03:34 UTC.\n\n| Platform | Best Operation | `getifs` | Alternative | Speedup |\n|----------|----------------|----------|-------------|---------|\n| **macOS** (Apple M4 Pro) | Get interface by index | 1.7 μs | 314.2 μs | **189x faster** |\n| **macOS** (Apple M4 Pro) | List all interfaces | 8.4 μs | 313.0 μs | **37x faster** |\n| **Linux** (x64) | Local IPv4 lookup | 13.7 μs | 94.3 μs | **6.9x faster** |\n| **Linux** (x64) | List all interfaces | 41.5 μs | 111.7 μs | **2.7x faster** |\n| **Windows** (x64) | Gateway IPv4 | 30.2 μs | N/A | Unique feature |\n\n### Detailed Results\n\n#### Interface Operations\n\n**macOS (Apple M4 Pro, 24 GB, local bare-metal)**\n\n| Operation | `getifs` | Alternative | Speedup |\n|-----------|----------|-------------|---------|\n| List all interfaces | 8.4 μs | 313.0 μs (`network-interface`) | **37x faster** |\n| Get interface by index | 1.7 μs | 314.2 μs (`network-interface`) | **189x faster** |\n| Get interface by name | 10.4 μs | 314.1 μs (`network-interface`) | **30x faster** |\n| Get interface addresses | 8.4 μs | - | - |\n| Get multicast addresses | 2.9 μs | - | - |\n\n**Linux (GitHub Actions x64)**\n\n| Operation | `getifs` | Alternative | Speedup |\n|-----------|----------|-------------|---------|\n| List all interfaces | 41.5 μs | 111.7 μs (`network-interface`) | **2.7x faster** |\n| Get interface by index | 40.3 μs | 111.9 μs (`network-interface`) | **2.8x faster** |\n| Get interface by name | 46.1 μs | 111.9 μs (`network-interface`) | **2.4x faster** |\n| Get interface addresses | 17.3 μs | - | - |\n| Get multicast addresses | 31.4 μs | - | - |\n\n**Windows (GitHub Actions x64)**\n\n| Operation | `getifs` | Alternative | Notes |\n|-----------|----------|-------------|-------|\n| List all interfaces | 974 μs | 967 μs (`network-interface`) | Within noise |\n| Get interface by index | 954 μs | 976 μs (`network-interface`) | Within noise |\n| Get interface by name | 1011 μs | 969 μs (`network-interface`) | Within noise |\n| Get interface addresses | 958 μs | - | - |\n| Get multicast addresses | 966 μs | - | - |\n\n*Note: the Win32 `GetAdaptersAddresses` API has an inherent ~1 ms floor\nthat dominates every implementation — `getifs` and `network-interface`\nend up within measurement noise of each other on Windows.*\n\n#### Local IP Address Operations\n\n**macOS (Apple M4 Pro, 24 GB, local bare-metal)**\n\n| Operation | `getifs` | Alternative | Speedup |\n|-----------|----------|-------------|---------|\n| Get local IPv4 address | 6.5 μs | 9.8 μs (`local-ip-address`) | **1.5x faster** |\n| Get local IPv6 address | 7.9 μs | 9.8 μs (`local-ip-address`) | **1.2x faster** |\n\n**Linux (GitHub Actions x64)**\n\n| Operation | `getifs` | Alternative | Speedup |\n|-----------|----------|-------------|---------|\n| Get local IPv4 address | 13.7 μs | 94.3 μs (`local-ip-address`) | **6.9x faster** |\n| Get local IPv6 address | 11.2 μs | - | No IPv6 result from alternative |\n\n**Windows (GitHub Actions x64)**\n\n| Operation | `getifs` | Alternative | Notes |\n|-----------|----------|-------------|-------|\n| Get local IPv4 address | 963 μs | 919 μs (`local-ip-address`) | Win32 ~1 ms floor |\n| Get local IPv6 address | 992 μs | 972 μs (`local-ip-address`) | Win32 ~1 ms floor |\n\n#### Gateway Operations\n\n| Platform | IPv4 Gateways | IPv6 Gateways | All Gateways |\n|----------|---------------|---------------|--------------|\n| **macOS** (M4 Pro, local) | 17.5 μs | 2.4 μs | 19.8 μs |\n| **Linux** (x64, CI) | 18.4 μs | 14.3 μs | 22.4 μs |\n| **Windows** (x64, CI) | 30.2 μs | 18.0 μs | 48.5 μs |\n\n*Note: No direct alternatives available for gateway discovery, so these\nare reported as absolute times rather than as speedups.*\n\n**Why is `getifs` faster?**\n\n- **Direct system calls**: Uses platform-native APIs (netlink on Linux, sysctl on BSD/macOS, GetAdaptersAddresses on Windows)\n- **Zero-copy parsing**: Minimal allocations and efficient buffer reuse\n- **No libc dependency** on Linux: Direct netlink socket communication\n- **Optimized data structures**: Uses `SmallVec` and `SmolStr` to avoid heap allocations for common cases\n\n**Platform Performance Notes:**\n\n- **macOS**: Shows the largest speedups (30–189x on bare metal) due to\n  the efficient sysctl-based implementation avoiding `getifaddrs`'s\n  per-call overhead. On shared CI runners the absolute numbers are\n  noisier but the ordering holds.\n- **Linux**: 2.4–2.8x faster interface enumeration via direct netlink,\n  and ~7x faster local-IP lookup from avoiding the test-socket round\n  trip that `local-ip-address` performs.\n- **Windows**: Similar performance to alternatives — `GetAdaptersAddresses`\n  has an inherent ~1 ms floor that dominates every implementation.\n\n## Sister crates\n\n- [`iprobe`](https://github.com/al8n/iprobe): Probe if the host system supports IPv4, IPv6 and IPv4-mapped-IPv6.\n- [`iprfc`](https://github.com/al8n/iprfc): Known RFCs for IP addresses.\n\n## Pedigree\n\n- The code in this crate is inspired by Golang's `interface.go` and [HashiCorp's go-sockaddr](https://github.com/hashicorp/go-sockaddr).\n\n#### License\n\n`getifs` is under the terms of both the MIT license and the\nApache License (Version 2.0).\n\nSee [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT) for details.\n\nCopyright (c) 2026 Al Liu.\n\n[Github-url]: https://github.com/al8n/getifs/\n[CI-url]: https://github.com/al8n/getifs/actions/workflows/ci.yml\n[doc-url]: https://docs.rs/getifs\n[crates-url]: https://crates.io/crates/getifs\n[codecov-url]: https://app.codecov.io/gh/al8n/getifs/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal8n%2Fgetifs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal8n%2Fgetifs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal8n%2Fgetifs/lists"}