schemars/json_schema_impls/
wrapper.rs1use crate::JsonSchema;
2use crate::_alloc_prelude::*;
3
4macro_rules! wrapper_impl {
5 ($($desc:tt)+) => {
6 forward_impl!(($($desc)+ where T: JsonSchema) => T);
7 };
8}
9
10wrapper_impl!(<'a, T: ?Sized> JsonSchema for &'a T);
11wrapper_impl!(<'a, T: ?Sized> JsonSchema for &'a mut T);
12wrapper_impl!(<T: ?Sized> JsonSchema for Box<T>);
13wrapper_impl!(<T: ?Sized> JsonSchema for alloc::rc::Rc<T>);
14wrapper_impl!(<T: ?Sized> JsonSchema for alloc::rc::Weak<T>);
15wrapper_impl!(<T: ?Sized> JsonSchema for alloc::sync::Arc<T>);
16wrapper_impl!(<T: ?Sized> JsonSchema for alloc::sync::Weak<T>);
17#[cfg(feature = "std")]
18wrapper_impl!(<T: ?Sized> JsonSchema for std::sync::Mutex<T>);
19#[cfg(feature = "std")]
20wrapper_impl!(<T: ?Sized> JsonSchema for std::sync::RwLock<T>);
21wrapper_impl!(<T: ?Sized> JsonSchema for core::cell::Cell<T>);
22wrapper_impl!(<T: ?Sized> JsonSchema for core::cell::RefCell<T>);
23wrapper_impl!(<'a, T: ?Sized + ToOwned> JsonSchema for alloc::borrow::Cow<'a, T>);
24wrapper_impl!(<T> JsonSchema for core::num::Wrapping<T>);
25wrapper_impl!(<T> JsonSchema for core::cmp::Reverse<T>);