#![warn(missing_docs)]
#![deny(rustdoc::broken_intra_doc_links)]
pub mod actor;
pub mod error;
pub use actor::{run, Actor, Handle, Requestor};
pub use error::Error;
pub use tokio::{sync::mpsc, task::JoinHandle};
#[cfg(test)]
mod tests {
use async_trait::async_trait;
use crate::actor::*;
use crate::Error;
#[derive(Debug)]
struct NormalType;
#[async_trait]
impl Actor for NormalType {
type Request = usize;
type Response = bool;
async fn handle(&mut self, _message: Self::Request) -> Option<Self::Response> {
unreachable!()
}
}
const fn is_send_sync<T: Sized + Send + Sync + Unpin>() {}
const fn impls_or_derives_debug<Debug>() {}
#[test]
const fn test_public_types() {
is_send_sync::<Requestor<NormalType, NormalType>>();
is_send_sync::<Handle<NormalType>>();
is_send_sync::<Error>();
}
#[test]
const fn test_impls_debug() {
impls_or_derives_debug::<Requestor<NormalType, NormalType>>();
impls_or_derives_debug::<Handle<NormalType>>();
impls_or_derives_debug::<Error>();
}
}