Release of Rust 1.95. Adding Rust to the Mir display server. AyaFlow traffic analyzer in Rust.

The release of the Rust programming language 1.95 has been published, originally developed by Mozilla and now maintained under the auspices of the independent non-profit organization Rust Foundation. The language focuses on safe memory handling and provides tools for achieving high parallelism in task execution while avoiding the need for a garbage collector and runtime (runtime is limited to basic initialization and maintenance of the standard library).

Memory handling methods in Rust aim to eliminate errors when manipulating pointers and protect against issues arising from low-level memory operations, such as accessing memory after it has been freed, dereferencing null pointers, buffer overflows, etc. To facilitate library distribution, ensure compilation, and manage project dependencies, the package manager Cargo is being developed. A repository, crates.io, is supported for hosting libraries.

Safe memory handling in Rust is ensured at compile time through reference checking, ownership tracking of objects, lifetime consideration (scope) of objects, and assessment of memory access correctness during code execution. Rust also provides means to protect against integer overflows, mandates the initialization of variable values before use, improved error handling in the standard library, employs the concept of immutability for references and variables by default, and offers strong static typing to minimize logical errors.

Key innovations:

  • The macro "cfg_select!" has been added, which can be used instead of the "cfg-if" package for handling multiple compilation conditions in a match-like style, without defining a chain of conditional expressions with the #[cfg] construct. cfg_select! { unix => { fn foo() { /* unix */ } } target_pointer_width = "32" => { fn foo() { /* not unix, 32-bit */ } } _ => { fn foo() { /* not unix and not 32-bit */ } } }
  • The ability to specify "if let" expressions within match blocks for creating pattern matching conditions has been stabilized. Previously, support for specifying multiple "let" expressions using the "&&" operator was stabilized for if and while blocks. match value { Some(x) if let Ok(y) = compute(x) => { println!("{}, {}", x, y); } _ => {} }
  • Support for inline assembly for PowerPC and PowerPC64 architectures has been stabilized.
  • A new batch of APIs has been promoted to stable, including stabilized methods and trait implementations:
    • MaybeUninit: From<[MaybeUninit; N]>
    • MaybeUninit: AsRef<[MaybeUninit; N]>
    • MaybeUninit: AsRef<[MaybeUninit]>
    • MaybeUninit: AsMut<[MaybeUninit; N]>
    • MaybeUninit: AsMut<[MaybeUninit]>
    • [MaybeUninit; N]: From<MaybeUninit
    • Cell: AsRef<[Cell; N]>
    • Cell: AsRef<[Cell]>
    • Cell: AsRef<[Cell]>
    • bool: TryFrom
    • AtomicPtr::update
    • AtomicPtr::try_update
    • AtomicBool::update
    • AtomicBool::try_update
    • AtomicIn::update
    • AtomicIn::try_update
    • AtomicUn::update
    • AtomicUn::try_update
    • cfg_select!
    • mod core::range
    • core::range::RangeInclusive
    • core::range::RangeInclusiveIter
    • core::hint::cold_path
    • ::as_ref_unchecked
    • ::as_ref_unchecked
    • ::as_mut_unchecked
    • Vec::push_mut
    • Vec::insert_mut
    • VecDeque::push_front_mut
    • VecDeque::push_back_mut
    • VecDeque::insert_mut
    • LinkedList::push_front_mut
    • LinkedList::push_back_mut
    • Layout::dangling_ptr
    • Layout::repeat
    • Layout::repeat_packed
    • Layout::extend_packed
  • The ‘const’ attribute has been applied in the functions:
    • fmt::from_fn
    • ControlFlow::is_break
    • ControlFlow::is_continue
  • Support for passing custom target platform specifications to the compiler has been removed in stable toolchain versions.
  • Target platforms powerpc64-unknown-linux-musl, aarch64-apple-tvos, aarch64-apple-tvos-sim, aarch64-apple-watchos, aarch64-apple-watchos-sim, aarch64-apple-visionos, and aarch64-apple-visionos-sim have been transitioned to second-level support, which entails a build guarantee but no guarantees during the testing suite.

Additionally, recent announced projects and events related to Rust can be noted:

  • Canonical has released the Mir 2.26 display server, providing a set of libraries for creating composite applications servers based on the Wayland protocol and including typical functionality of window managers and display servers. Mir is utilized in projects such as the Miracle composite manager, the Ubuntu Frame kiosk shell, and the Miriway desktop environment.

    The new release is notable for adding the ability to develop components in Rust. An alternative input management subsystem, evdev-rs, has been implemented in Rust, and work has begun on a Rust-based frontend, wayland-rs, for Wayland. Among non-Rust changes in Mir, support for Wayland protocols ext_image_copy_capture_v1 and input-triggers has been added.

  • The first release of the traffic analyzer ayaFlow has been published, developed in Rust and utilizing the Linux kernel's eBPF subsystem to intercept network packets (IPv4/TCP/UDP) and Ethernet frames with minimal performance impact. It supports deep inspection of application layer protocols (L7), such as extracting TLS SNI and DNS queries when analyzing encrypted traffic. The system maintains a table of the current state of connections in DashMap format, saves history in SQLite, and provides statistics via REST API for Prometheus.
  • Multithreaded applications can now be created in Rust using std::thread functions and executed on the GPU.

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster