use super::{Json, JsonNew, ValueMut, ValueRef};
use cc_traits::{
CollectionMut, CollectionRef, GetMut, Iter, IterMut, KeyedRef, MapInsert, MapIter, MapIterMut,
PopBack, PushBack, Remove,
};
use std::hash::Hash;
pub trait JsonClone = Json + Clone
where
<Self as Json>::Number: Clone,
<Self as Json>::String: Clone,
<Self as Json>::Array: Clone,
<Self as Json>::Key: Clone,
<Self as Json>::Object: Clone;
pub trait JsonHash = Json
where
<Self as Json>::Number: Hash,
<Self as Json>::String: Hash;
pub trait JsonMut = Json
where
<Self as Json>::Array: CollectionMut + IterMut + PushBack + PopBack,
<Self as Json>::Object: CollectionMut
+ for<'a> GetMut<&'a str>
+ MapIterMut
+ MapInsert<<Self as Json>::Key>
+ for<'a> Remove<&'a str>;
pub trait JsonBuild = JsonNew
where
<Self as Json>::String: for<'a> From<&'a str>,
<Self as Json>::Array: Default + std::iter::FromIterator<Self>,
<Self as Json>::Object: Default + std::iter::FromIterator<(<Self as Json>::Key, Self)>;
pub trait JsonSend = Json + Send
where
<Self as Json>::Number: Send,
<Self as Json>::String: Send,
<Self as Json>::Array: Send,
<Self as Json>::Key: Send,
<Self as Json>::Object: Send;
pub trait JsonSync = Json + Sync
where
<Self as Json>::Number: Sync,
<Self as Json>::String: Sync,
<Self as Json>::Array: Sync,
for<'a> <<Self as Json>::Array as CollectionRef>::ItemRef<'a>: Send + Sync,
for<'a> <<Self as Json>::Array as Iter>::Iter<'a>: Send + Sync,
<Self as Json>::Key: Sync,
<Self as Json>::Object: Sync,
for<'a> <<Self as Json>::Object as KeyedRef>::KeyRef<'a>: Send + Sync,
for<'a> <<Self as Json>::Object as CollectionRef>::ItemRef<'a>: Send + Sync,
for<'a> <<Self as Json>::Object as MapIter>::Iter<'a>: Send + Sync;
pub trait JsonSendSync = JsonSync + JsonSend;
pub trait JsonMutSendSync = JsonMut + JsonSendSync
where
for<'a> <<Self as Json>::Array as CollectionMut>::ItemMut<'a>: Send,
for<'a> <<Self as Json>::Object as CollectionMut>::ItemMut<'a>: Send;
pub trait JsonIntoRef = Json
where
for<'a> <<Self as Json>::Array as CollectionRef>::ItemRef<'a>: Into<ValueRef<'a, Self>>,
for<'a> <<Self as Json>::Object as CollectionRef>::ItemRef<'a>: Into<ValueRef<'a, Self>>;
pub trait JsonIntoMut = JsonMut
where
for<'a> <<Self as Json>::Array as CollectionMut>::ItemMut<'a>: Into<ValueMut<'a, Self>>,
for<'a> <<Self as Json>::Object as CollectionMut>::ItemMut<'a>: Into<ValueMut<'a, Self>>;
pub trait JsonLft<'a> = Json + 'a
where
<Self as Json>::MetaData: 'a,
<Self as Json>::Number: 'a,
<Self as Json>::String: 'a,
<Self as Json>::Array: 'a,
<Self as Json>::Key: 'a,
<Self as Json>::Object: 'a;