1 /* 2 * Copyright (C) 2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /// # Example 17 /// 18 /// ```ignore 19 /// impl_serde_option_for_parcelable!(i32, bool); 20 /// ``` 21 #[macro_export] 22 macro_rules! impl_serde_option_for_parcelable { 23 ($($ty:ty),*) => { 24 $( 25 impl SerOption for $ty {} 26 impl DeOption for $ty {} 27 )* 28 }; 29 } 30 31 pub mod bool; 32 pub mod integer; 33 pub mod option; 34 pub mod reference; 35 pub mod strings; 36 pub mod interface_token; 37 pub mod string16; 38 pub mod file_desc; 39 pub mod boxt; 40 pub mod const_array; 41 pub mod slices; 42 pub mod vector; 43 44 pub use self::string16::on_string16_writer; 45 pub use self::strings::vec_u16_to_string; 46 pub use self::strings::vec_to_string; 47 48 use crate::parcel::parcelable::*; 49 use std::ffi::{c_char, c_void}; 50 use crate::{ 51 ipc_binding, BorrowedMsgParcel, AsRawPtr, status_result, 52 IpcResult, IpcStatusCode, SerOption, DeOption 53 }; 54