{"id":19299194,"url":"https://github.com/bmatcuk/libuv-sys","last_synced_at":"2026-03-05T17:17:38.745Z","repository":{"id":55003487,"uuid":"216294699","full_name":"bmatcuk/libuv-sys","owner":"bmatcuk","description":"Rust ffi bindings for libuv","archived":false,"fork":false,"pushed_at":"2025-01-16T19:09:56.000Z","size":98,"stargazers_count":13,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-01T22:14:39.890Z","etag":null,"topics":["libuv","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bmatcuk.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-20T02:04:53.000Z","updated_at":"2025-02-01T18:56:32.000Z","dependencies_parsed_at":"2024-11-09T23:10:40.848Z","dependency_job_id":"d0870623-5ca3-4111-a6ca-14096749f395","html_url":"https://github.com/bmatcuk/libuv-sys","commit_stats":{"total_commits":61,"total_committers":2,"mean_commits":30.5,"dds":"0.032786885245901676","last_synced_commit":"4ac2d9a3b973d709f93dea155609578965de1a9c"},"previous_names":[],"tags_count":66,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatcuk%2Flibuv-sys","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatcuk%2Flibuv-sys/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatcuk%2Flibuv-sys/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bmatcuk%2Flibuv-sys/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bmatcuk","download_url":"https://codeload.github.com/bmatcuk/libuv-sys/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248968737,"owners_count":21191159,"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","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":["libuv","rust"],"created_at":"2024-11-09T23:10:30.560Z","updated_at":"2026-03-05T17:17:38.704Z","avatar_url":"https://github.com/bmatcuk.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://github.com/bmatcuk/libuv-sys/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/bmatcuk/libuv-sys/actions)\n[![Latest Release](https://img.shields.io/crates/v/libuv-sys2)](https://crates.io/crates/libuv-sys2)\n\n# libuv-sys2\nlibuv-sys2 provides ffi bindings to the [libuv] library.\n\n## Why libuv-sys2?\nI am committed to maintaining libuv-sys2. In fact, releases are largely\nautomated. When [libuv] releases a new version, you may see a corresponding\nrelease of libuv-sys2 within minutes. Sometimes the release cannot be\ncompletely automated, however. In these cases, where I need to manually make\nsome changes, I aim to have a release within 24-hours.\n\n## Versioning\nlibuv-sys2 uses [semantic versioning], like libuv. Major and minor versions of\nlibuv-sys2 are bound to specific major/minor versions of libuv, ie, libuv-sys2\nv1.30.x corresponds to v1.30.x of libuv. The patch version of libuv-sys2 will\nchange anytime libuv releases a new patch version, _or_ if libuv-sys2 updates.\n\nNOTE: bindgen was updated in v1.45.0 which changed the types of many exported\nfunctions, so you'll likely need to make some changes if you are upgrading from\na prior version.\n\n## Getting Started\nInclude libuv-sys2 as a dependency in your Cargo.toml. It is recommended to use\nthe tilde operator when specifying your dependency on libuv-sys2 so that you'll\nautomatically received the latest bug fixes without any breaking API changes.\nFor example:\n\n```toml\n[dependencies]\nlibuv-sys2 = \"~1.34.1\"\n```\n\nThis would be the same as specifying the version as `\u003e= 1.34.1, \u003c 1.35.0`.\n\nIf you need a specific patch version of libuv, check the [releases] page to\nfind the version of libuv-sys2 that corresponds to the patch of libuv that you\nneed.\n\nUnder the hood, libuv-sys2 uses [bindgen] to generate the bindings to [libuv].\nIf you're having trouble compiling libuv-sys2, check out the [bindgen]\ndocumentation to make sure you have all the required software installed. For\nexample, on Windows, you'll need to use the msvc toolchain to compile\nlibuv-sys2.\n\nlibuv-sys2 will attempt to use [pkg-config] to find a matching local install of\n[libuv]. If that fails, it will build [libuv] from source. Starting with\nversion 1.40.1, you can enable the `skip-pkg-config` feature to always build\nfrom source. In prior versions, you could skip pkg-config by setting an\nenvironment variable called `LIBUV_NO_PKG_CONFIG`. See the [pkg-config]\ndocumentation for more information.\n\n## Usage\nImport the library in your project:\n\n```rust\n#[macro_use]\nextern crate libuv_sys2;\n```\n\nAs this library is a thin binding to [libuv], the first thing you should do is\nfamiliarize yourself with [libuv's documentation]. Once you're familiar with\nthe concepts, take a look at the [examples].\n\nSome general advice: any data (such as libuv handle types) that you are\nplanning on passing into libuv should _probably_ be allocated on the heap\n(using `Box`, for example). That way, they'll have a stable memory address.\nKeep in mind that rust's default is to allocate things on the stack, which\nmeans that their memory address changes if you pass it into a function or\nreturn it from a function, and it will get deallocated once it falls out of\nscope. It's very easy to write a progarm that will compile, but fail to run or\ncause all sorts of undefined behavior because you'll be passing around a lot of\nraw, unsafe pointers while interacting with the library. If something isn't\nworking, but you're pretty sure you're doing the right thing as far as [libuv]\nis concerned, make sure your data has a stable memory address.\n\nIn addition to bindings for all of the [libuv] functionality, this library\nprovides one convenience macro: `uv_handle!`. This macro can be used to convert\nany reference or raw pointer of one type, to a raw pointer of a different type.\nThis is frequently useful when using [libuv] to cast a `uv_SOMETHING_t` to a\n`uv_handle_t`. For example:\n\n```rust\nlet mut tty: uv_tty_t = unsafe { mem::zeroed() };\n\n// without the macro, you'd need to cast the reference to a raw pointer of the\n// same type, and then cast that as a raw pointer of the target type:\nlet handle: *mut uv_handle_t = \u0026mut tty as *mut uv_tty_t as *mut uv_handle_t;\n\n// the macro is much more wieldy:\nlet handle: *mut uv_handle_t = uv_handle!(\u0026mut tty);\n```\n\n## Cross-Platform Considerations\nIt appears the type of uv_buf_t.len is different on Windows. A simple solution\nis to use a usize (which appears to be the default elsewhere) and then any\nplace that you read from or write to a uv_buf_t.len, simply add a `as _` to the\nend and the compiler will do the right thing. For example:\n\n```rust\nlet buf: uv_buf_t = { base: my_ptr, len: my_len as _ };\nlet buflen: usize = buf.len as _;\n```\n\nSpeaking of Windows, because [bindgen] is used to generate the bindings, you'll\nneed to use rust's msvc toolchain to compile libuv-sys2!\n\n[bindgen]: https://rust-lang.github.io/rust-bindgen/\n[examples]: https://github.com/bmatcuk/libuv-sys/tree/master/examples\n[libuv's documentation]: http://docs.libuv.org\n[libuv]: https://libuv.org/\n[pkg-config]: https://github.com/rust-lang/pkg-config-rs\n[releases]: https://github.com/bmatcuk/libuv-sys/releases\n[semantic versioning]: https://semver.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmatcuk%2Flibuv-sys","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbmatcuk%2Flibuv-sys","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbmatcuk%2Flibuv-sys/lists"}