https://www.tectalk.co/microsoft-previews-rust-for-windows/ Skip to content TecTalk TecTalk Step Into The Light With Tectalk Primary Menu TecTalk TecTalk * Home * Tech News * Tech Talk * Software * Personal Tech * Programming * Gaming Search for: [ ] [Search] * Tech Talk Microsoft Previews Rust For Windows 17 hours ago TecTalk [1_q_iwdpJByT_Z7J8tCQ3g6Q-1024x513] Microsoft announced the preview of Rust for Windows, which aims to enable creating Rust apps for Windows using any Windows API. Rust for Windows aims to make available both older and more recent APIs by leveraging the win32metadata project to create idiomatic projections of Windows API for languages other than C# and F#. Rust for Windows is available through the windows crate: The windows crate lets you call any Windows API past, present, and future using code generated on the fly directly from the metadata describing the API and right into your Rust package where you can call them as if they were just another Rust module. The windows crate is able to generate bindings to all required Windows API on the fly. You specify which types you require inside of a build.rs file: fn main() { windows::build!( Windows::Data::Xml::Dom::*, Windows::Win32::WindowsProgramming::CloseHandle, Windows::Win32::WindowsAndMessaging::MessageBoxA, Windows::Win32::SystemServices::{ CreateEventW, SetEvent, WaitForSingleObject }, ); } The generated bindings can be then imported and used in Rust source files: mod bindings { ::windows::include_bindings!(); } use bindings::{ Windows::Data::Xml::Dom::*, Windows::Win32::SystemServices::{CreateEventW, SetEvent, WaitForSingleObject, PWSTR}, Windows::Win32::WindowsAndMessaging::{MessageBoxA, HWND, MESSAGEBOX_STYLE}, Windows::Win32::WindowsProgramming::CloseHandle, }; Microsoft has provided a number of sample programs exercising various Windows APIs, including Direct2D, Microsoft.Web.WebView2.Core, Win2D, and others. Additionally, Robert Mikhayelyan has ported Minesweeper to Windows for Rust. Rust is the latest language projection derived from win32metadata. Not only does win32metadata enable automated Windows API projections, it also strives to make using them easier by converting non-specific types like uint into specific enums, opaque types like HANDLE and GDI objects into strongly-typed structs, and so on. Rust documentation for all projected APIs is also available to describe how the Windows APIs and types are projected into idiomatic Rust. As mentioned, Rust for Windows is still in preview and the project welcomes contributions to identify and fix bugs in the source code. Continue Reading Previous Programming by Voice May Be the Next Frontier in Software Development Next How to connect Bluetooth headphones to an Xbox One More Stories * Tech Talk SafeMoon Crypto to Be Available on Two New Exchanges, Creators Say 7 hours ago TecTalk * Tech Talk VeChain (VET) Price Prediction: Is a 22% Upside to $0.3385 Possible? 7 hours ago TecTalk * Tech Talk Dogecoin's Market Cap Maxes out North of $50 Billion 8 hours ago TecTalk Leave a Reply Cancel reply Your email address will not be published. Required fields are marked * [ ] [ ] [ ] [ ] [ ] [ ] [ ] Comment [ ] Name * [ ] Email * [ ] Website [ ] [ ] Save my name, email, and website in this browser for the next time I comment. [Post Comment] Follow us * facebook * twitter * instagram * pinterest * linkedin You may have missed * Tech Talk SafeMoon Crypto to Be Available on Two New Exchanges, Creators Say 7 hours ago TecTalk * Tech Talk VeChain (VET) Price Prediction: Is a 22% Upside to $0.3385 Possible? 7 hours ago TecTalk * Tech Talk Dogecoin's Market Cap Maxes out North of $50 Billion 8 hours ago TecTalk * Tech Talk Binance Coin regains 20% in a day: Why is BNB seeing such a strong recovery? 8 hours ago TecTalk * Tech Talk GameStop shares soar after CEO departure news, 'RoaringKitty' doubles stake 8 hours ago TecTalk * About Us * Contact Us * Privacy Policy * Terms and Conditions (c) 2020 TecTalk | CoverNews by AF themes.