OpenCloudOS-Kernel/rust/kernel
Wedson Almeida Filho 65e1e497f6 rust: str: add `CString` type
Add the `CString` type, which is an owned string that is guaranteed
to have exactly one `NUL` byte at the end, i.e. the owned equivalent
to `CStr` introduced earlier.

It is used for interoperability with kernel APIs that take C strings.

In order to do so, implement the `RawFormatter::new()` constructor
and the `RawFormatter::bytes_written()` method as well.

Signed-off-by: Wedson Almeida Filho <wedsonaf@gmail.com>
[Reworded, adapted for upstream and applied latest changes]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-12-04 01:59:15 +01:00
..
allocator.rs rust: add `kernel` crate 2022-09-28 08:58:24 +02:00
error.rs rust: error: add `From` implementations for `Error` 2022-12-04 01:59:15 +01:00
lib.rs rust: error: add `From` implementations for `Error` 2022-12-04 01:59:15 +01:00
prelude.rs rust: str: add `CStr` type 2022-12-04 01:59:15 +01:00
print.rs rust: print: add `pr_cont!` macro 2022-12-01 20:12:44 +01:00
str.rs rust: str: add `CString` type 2022-12-04 01:59:15 +01:00