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 layers;
35pub mod raw;
36pub mod services;
37
38#[cfg(test)]
39mod tests {
40 use super::*;
41
42 trait AssertSendSync: Send + Sync {}
43 impl AssertSendSync for Entry {}
44 impl AssertSendSync for Capability {}
45 impl AssertSendSync for Error {}
46 impl AssertSendSync for Reader {}
47 impl AssertSendSync for Writer {}
48 impl AssertSendSync for Lister {}
49 impl AssertSendSync for Operator {}
50
51 /// This is used to make sure our public API implement Send + Sync
52 #[test]
53 fn test_trait() {
54 let _: Box<dyn AssertSendSync> = Box::new(Capability::default());
55 }
56}