1 stable release
1.0.0 | Aug 3, 2020 |
---|
#241 in No standard library
6,950 downloads per month
Used in 14 crates
(2 directly)
58KB
1K
SLoC
unix_str
Unix-compatible strings regardless of platform, including #![no_std]
environents. This crate is extracted from std
.
Features
shrink_to
: implements the unstableshrink_to
method;unixstring_ascii
: ASCII transformations,std
's unstable feature;toowned_clone_into
: implementsToOwned::clone_into
, an unstable method;alloc
: implementsUnixString
and transformations withBox
,Rc
andArc
;std
: an alias foralloc
.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
lib.rs
:
Strings that are compatible wuth Unix-like operating systems.
-
UnixString
andUnixStr
are useful when you need to with Unix strings. Conversions betweenUnixString
,UnixStr
and Rust strings work similarly to those forCString
andCStr
. -
UnixString
represents an owned string in Unix's preferred representation. -
UnixStr
represents a borrowed reference to a string in a format that can be passed to a Unix-lie operating system. It can be converted into a UTF-8 Rust string slice in a similar way toUnixString
.
Conversions
UnixStr
implements two methods, from_bytes
and as_bytes
.
These do inexpensive conversions from and to UTF-8 byte slices.
Additionally, UnixString
provides from_vec
and into_vec
methods
that consume their arguments, and take or produce vectors of [u8
].