100 releases

0.30.0 Apr 27, 2024
0.29.15 Mar 13, 2024
0.29.11 Feb 26, 2024
0.29.8 Dec 31, 2023
0.4.9 Mar 26, 2016

#3 in GUI

Download history 99759/week @ 2024-02-08 88473/week @ 2024-02-15 95746/week @ 2024-02-22 115868/week @ 2024-02-29 108610/week @ 2024-03-07 106506/week @ 2024-03-14 99455/week @ 2024-03-21 132831/week @ 2024-03-28 88740/week @ 2024-04-04 101964/week @ 2024-04-11 102349/week @ 2024-04-18 102191/week @ 2024-04-25 96919/week @ 2024-05-02 94112/week @ 2024-05-09 118480/week @ 2024-05-16 92441/week @ 2024-05-23

418,023 downloads per month
Used in 2,228 crates (652 directly)

Apache-2.0

2MB
42K SLoC

winit - Cross-platform window creation and management in Rust

Crates.io Docs.rs Master Docs CI Status

[dependencies]
winit = "0.30.0"

Documentation

For features within the scope of winit, see FEATURES.md.

For features outside the scope of winit, see Are we GUI Yet? and Are we game yet?, depending on what kind of project you're looking to do.

Contact Us

Join us in our Matrix room. If you don't get an answer there, try Libera.Chat.

The maintainers have a meeting every friday at UTC 15. The meeting notes can be found here.

Usage

Winit is a window creation and management library. It can create windows and lets you handle events (for example: the window being resized, a key being pressed, a mouse movement, etc.) produced by the window.

Winit is designed to be a low-level brick in a hierarchy of libraries. Consequently, in order to show something on the window you need to use the platform-specific getters provided by winit, or another library.

MSRV Policy

This crate's Minimum Supported Rust Version (MSRV) is 1.70. Changes to the MSRV will be accompanied by a minor version bump.

As a tentative policy, the upper bound of the MSRV is given by the following formula:

min(sid, stable - 3)

Where sid is the current version of rustc provided by Debian Sid, and stable is the latest stable version of Rust. This bound may be broken in case of a major ecosystem shift or a security vulnerability.

The exception is for the Android platform, where a higher Rust version must be used for certain Android features. In this case, the MSRV will be capped at the latest stable version of Rust minus three. This inconsistency is not reflected in Cargo metadata, as it is not powerful enough to expose this restriction.

All crates in the rust-windowing organizations have the same MSRV policy.

Platform-specific usage

Check out the winit::platform module for platform-specific usage.

Dependencies

~0.5–20MB
~296K SLoC