unique_name
Build a name no other caller in this process will produce.
Source and package
- Qualified name
-
libtmux::test:: unique _name - Module
- test
- Package
- libtmux
- Source
- crates/libtmux/src/test.rs
-
Description#
The name combines the prefix, the process id, and a counter. Unlike a random name it needs no collision check and no random source, and unlike a bare counter it does not collide between concurrent test processes sharing one server.
Examples#
use libtmux::test::unique_name;let first = unique_name("libtmux");let second = unique_name("libtmux");assert_ne!(first, second);assert!(first.starts_with("libtmux-"));