Skip to main content

cedar_policy/
lib.rs

1/*
2 * Copyright Cedar Contributors
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 *      https://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// Includes the cedar-policy README as the top-level documentation for this
18// crate. This also acts as a test that the example code in the README
19// compiles. If changing the docs away from using the readme verbatim, be sure
20// to add a separate test specifically for README examples by introducing a
21// private, empty, and unused function with `#[doc = include_str!("../README.md")]`.
22#![doc = include_str!("../README.md")]
23#![warn(clippy::pedantic, clippy::use_self, clippy::option_if_let_else)]
24#![deny(
25    missing_docs,
26    rustdoc::broken_intra_doc_links,
27    rustdoc::private_intra_doc_links,
28    rustdoc::invalid_codeblock_attributes,
29    rustdoc::invalid_html_tags,
30    rustdoc::invalid_rust_codeblocks,
31    rustdoc::bare_urls,
32    clippy::doc_markdown,
33    clippy::doc_lazy_continuation,
34    clippy::too_long_first_doc_paragraph
35)]
36#![allow(
37    clippy::must_use_candidate,
38    reason = "in the future we can enable this lint but currently it doesn't pass"
39)]
40// enable doc_cfg feature if docsrs cfg is present
41#![cfg_attr(docsrs, feature(doc_cfg))]
42#![cfg_attr(
43    feature = "wasm",
44    allow(
45        non_snake_case,
46        reason = "Wasm/TypeScript doesn't use snake case identifiers by convention"
47    )
48)]
49
50/// Rust public API
51mod api;
52
53pub use api::version::{get_lang_version, get_sdk_version};
54pub use api::*;
55
56/// FFI utilities, see comments in the module itself
57pub mod ffi;
58
59/// Protobuf models of cedar-policy types
60#[cfg(feature = "protobufs")]
61pub mod proto;
62
63mod test;