Debian Codegraph @

third_party/rust/unix_str/src/sys_common.rs

raw
1 //! Platform-independent platform abstraction
2 //!
3 //! This is the platform-independent portion of the standard library's
4 //! platform abstraction layer, whereas `std::sys` is the
5 //! platform-specific portion.
6 //!
7 //! The relationship between `std::sys_common`, `std::sys` and the
8 //! rest of `std` is complex, with dependencies going in all
9 //! directions: `std` depending on `sys_common`, `sys_common`
10 //! depending on `sys`, and `sys` depending on `sys_common` and `std`.
11 //! Ideally `sys_common` would be split into two and the dependencies
12 //! between them all would form a dag, facilitating the extraction of
13 //! `std::sys` from the standard library.
14
15 pub mod bytestring;
16
17 /// A trait for viewing representations from std types
18 #[doc(hidden)]
19 pub trait AsInner<Inner: ?Sized> {
20 fn as_inner(&self) -> &Inner;
21 }
22
23 /// A trait for viewing representations from std types
24 #[doc(hidden)]
25 pub trait AsInnerMut<Inner: ?Sized> {
26 fn as_inner_mut(&mut self) -> &mut Inner;
27 }
28
29 /// A trait for extracting representations from std types
30 #[doc(hidden)]
31 pub trait IntoInner<Inner> {
32 fn into_inner(self) -> Inner;
33 }
34
35 /// A trait for creating std types from internal representations
36 #[doc(hidden)]
37 pub trait FromInner<Inner> {
38 fn from_inner(inner: Inner) -> Self;
39 }