Skip to main content

opendal_core/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#![doc(
19    html_logo_url = "https://raw.githubusercontent.com/apache/opendal/main/website/static/img/logo.svg"
20)]
21#![doc = include_str!("../README.md")]
22#![cfg_attr(docsrs, feature(doc_cfg))]
23#![cfg_attr(docsrs, doc(auto_cfg))]
24// Make sure all our public APIs have docs.
25#![deny(missing_docs)]
26
27// Private module with public types, they will be accessed via `opendal::Xxxx`
28mod types;
29pub use types::*;
30
31// Public modules, they will be accessed like `opendal::layers::Xxxx`
32#[cfg(feature = "blocking")]
33pub mod blocking;
34pub mod docs;
35pub mod layers;
36pub mod raw;
37pub mod services;
38
39#[cfg(test)]
40mod tests {
41    use super::*;
42
43    trait AssertSendSync: Send + Sync {}
44    impl AssertSendSync for Entry {}
45    impl AssertSendSync for Capability {}
46    impl AssertSendSync for Error {}
47    impl AssertSendSync for Reader {}
48    impl AssertSendSync for Writer {}
49    impl AssertSendSync for Lister {}
50    impl AssertSendSync for Operator {}
51
52    /// This is used to make sure our public API implement Send + Sync
53    #[test]
54    fn test_trait() {
55        let _: Box<dyn AssertSendSync> = Box::new(Capability::default());
56    }
57}