• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2025 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 ///! Entry point to a new tipc user space API. The goal of this module are three folds:
18 ///  1. the ability to share the handleset with the event loop as well as a
19 ///     service
20 ///  2. removing the dispatcher(present in the legacy Rust tipc library) from the event pipeline
21 ///  3. make the user space constructs thread safe, so that they can be shared with RPC binder
22 ///     services which has the thread safety requirement
23 ///
24 ///  A TA initialization code may use this API in the following manner to get the advantage of
25 ///  the aforementioned features.
26 ///  1. Create a `HandleSetWrapper` that manages a particular type of handle objects in an instance
27 ///     of a `RawHandleSet`.
28 ///  2. Create a tipc service that implements a given `*Service` trait
29 ///  3. Create a port type handle object containing a reference to the service and register it in
30 ///     the `HandleSetWrapper`.
31 ///  4. Give a reference of the `HandleSetWrapper` to the service, if the service needs to
32 ///     manipulate the `HandleSetWrapper`.
33 ///  5. Create the `EventLoop` with a reference to the HandleSetWrapper and run the `EventLoop`.
34 ///
35 ///  Note: This crate currently accommodates the services that implement the`UnbufferredService`
36 ///  trait only. It is a future work to implement a common `HandleSetWrapper` that can accommodate
37 ///  the services that implement the `Service` trait.
38 mod event_loop;
39 mod handle_set_wrapper;
40 mod raw_handle_set;
41 mod service_handle;
42 
43 pub use event_loop::EventLoop;
44 pub use handle_set_wrapper::{HandleSetWrapper, ToConnect, WorkToDo};
45 pub use raw_handle_set::{Handler, RawHandleSet};
46 pub use service_handle::{HandleType, ServiceHandle};
47