summaryrefslogtreecommitdiff
path: root/rust/kernel/prelude.rs
diff options
context:
space:
mode:
authorWedson Almeida Filho <wedsonaf@gmail.com>2022-11-10 17:41:33 +0100
committerMiguel Ojeda <ojeda@kernel.org>2022-12-04 01:59:15 +0100
commit65e1e497f6d63f747d453b3d89fbeb6d140cbbb7 (patch)
treed03d1cdb54c8a1fbb17eb2d3bf06974678e1a1a8 /rust/kernel/prelude.rs
parentfffed679eeea119c8f972954518c142ec95bda4a (diff)
downloadlinux-65e1e497f6d63f747d453b3d89fbeb6d140cbbb7.tar.gz
linux-65e1e497f6d63f747d453b3d89fbeb6d140cbbb7.tar.bz2
linux-65e1e497f6d63f747d453b3d89fbeb6d140cbbb7.zip
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>
Diffstat (limited to 'rust/kernel/prelude.rs')
0 files changed, 0 insertions, 0 deletions