use crate::*;
impl<T: ?Sized + ToOutput> ToOutput for Arc<T> {
fn to_output(&self, output: &mut impl Output) {
(**self).to_output(output);
}
}
impl<T: ?Sized + InlineOutput> InlineOutput for Arc<T> {}
impl<T: Parse<I>, I: ParseInput> Parse<I> for Arc<T> {
fn parse(input: I) -> crate::Result<Self> {
T::parse(input).map(Self::new)
}
}
impl<T: ParseInline<I>, I: ParseInput> ParseInline<I> for Arc<T> {
fn parse_inline(input: &mut I) -> crate::Result<Self> {
T::parse_inline(input).map(Self::new)
}
}
impl<T: ?Sized + ListHashes> ListHashes for Arc<T> {
fn list_hashes(&self, f: &mut impl FnMut(Hash)) {
(**self).list_hashes(f);
}
fn topology_hash(&self) -> Hash {
(**self).topology_hash()
}
fn point_count(&self) -> usize {
(**self).point_count()
}
}
impl<T: ?Sized + Topological> Topological for Arc<T> {
fn traverse(&self, visitor: &mut impl PointVisitor) {
(**self).traverse(visitor);
}
fn topology(&self) -> TopoVec {
(**self).topology()
}
}
impl<T: ?Sized + Tagged> Tagged for Arc<T> {
const TAGS: Tags = T::TAGS;
const HASH: Hash = T::HASH;
}
impl<T: ?Sized + Size> Size for Arc<T> {
const SIZE: usize = T::SIZE;
type Size = T::Size;
}
impl<T: ?Sized + MaybeHasNiche> MaybeHasNiche for Arc<T> {
type MnArray = T::MnArray;
}
impl<T: Clone> Equivalent<T> for Arc<T> {
fn into_equivalent(self) -> T {
Arc::unwrap_or_clone(self)
}
fn from_equivalent(object: T) -> Self {
Arc::new(object)
}
}
impl<T: ?Sized + ByteOrd> ByteOrd for Arc<T> {
fn bytes_cmp(&self, other: &Self) -> std::cmp::Ordering {
(**self).bytes_cmp(other)
}
}
impl<T: ?Sized + FetchBytes> FetchBytes for Arc<T> {
fn fetch_bytes(&'_ self) -> FailFuture<'_, ByteNode> {
(**self).fetch_bytes()
}
fn fetch_data(&'_ self) -> FailFuture<'_, Vec<u8>> {
(**self).fetch_data()
}
fn fetch_bytes_local(&self) -> Result<Option<ByteNode>> {
(**self).fetch_bytes_local()
}
fn fetch_data_local(&self) -> Option<Vec<u8>> {
(**self).fetch_data_local()
}
fn as_inner(&self) -> Option<&dyn Any> {
(**self).as_inner()
}
fn as_resolve(&self) -> Option<&Arc<dyn Resolve>> {
(**self).as_resolve()
}
fn try_unwrap_resolve(self: Arc<Self>) -> Option<Arc<dyn Resolve>> {
Arc::try_unwrap(self).ok()?.try_unwrap_resolve()
}
}
impl<T: ?Sized + Singular> Singular for Arc<T> {
fn hash(&self) -> Hash {
(**self).hash()
}
}