use std::{error::Error, fmt::Display, sync::Arc};
use crate::func::*;
use crate::mode::*;
use crate::rcore::*;
pub mod atomic;
pub mod atomic_object;
pub mod collections;
pub mod counting;
pub mod inject;
pub mod inlining;
mod local_origin;
pub mod nullable;
pub mod point;
pub mod singular;
pub mod tcast;
pub mod tracing;
pub mod typeless;
mod wrapped_origin;
impl Display for Address {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}@{}", hex(&self.point), self.index)
}
}
pub trait SerializableExt: Serializable {
fn bytes(&self) -> Vec<u8> {
let mut vec = Vec::new();
self.serialize(&mut vec);
vec
}
}
impl<S: Serializable> SerializableExt for S {}
pub trait ResolverExt<'a, Ctx: Context<'a>>: Resolver<'a, Ctx> + Sized {
fn into_rc(self) -> Arc<dyn Resolver<'a, Ctx>> {
Arc::new(self)
}
}
impl<'a, Ctx: Context<'a>, R: Resolver<'a, Ctx>> ResolverExt<'a, Ctx> for R {}