1 /*
2  * Copyright (C) 2021 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 //! # The Trusty IPC Library
18 //!
19 //! Implements IPC between Trusty userspace apps, the Trusty kernel, and the
20 //! non-secure kernel (Android).
21 //!
22 //! This library is based around the [`Handle`] type, which is an open
23 //! communication channel between a client and a service. This handle can send
24 //! and receive messages which implement [`Serialize`] and [`Deserialize`],
25 //! respectively. Receiving a message blocks until a message arrives or the
26 //! handle is closed.
27 
28 #![feature(allocator_api)]
29 
30 #[allow(non_camel_case_types)]
31 #[allow(unused)]
32 mod sys {
33     include!(env!("BINDGEN_INC_FILE"));
34 }
35 
36 mod err;
37 mod handle;
38 mod serialization;
39 mod service;
40 
41 pub use err::{ConnectResult, MessageResult, Result, TipcError};
42 pub use handle::{Handle, MMapFlags, UnsafeSharedBuf, MAX_MSG_HANDLES};
43 pub use serialization::{Deserialize, Serialize, Serializer};
44 pub use service::{Dispatcher, Manager, PortCfg, Service, UnbufferedService, Uuid};
45 
46 #[cfg(test)]
47 mod test {
48     #[test]
test()49     fn test() {}
50 
51     test::init!();
52 }
53