//! Dedicated tests for checking the public API of xtra.
use xtra::prelude::*;
use xtra::refcount::{Either, RefCounter};
pub trait AddressExt {}
// Ensures that we can abstract over addresses of any ref counter type.
impl AddressExt for Address {}
#[allow(dead_code)]
// The mere existence of this function already ensures that these public APIs exist, which is what we want to test!
#[allow(unknown_lints, clippy::let_underscore_future)]
fn functions_on_address_with_generic_rc_counter(
address1: Address,
address2: Address,
) where
A: Actor,
Rc: RefCounter,
Rc2: RefCounter,
A: Handler<(), Return = ()>,
{
address1.len();
address1.capacity();
let _ = address1.join();
let _ = address1.send(());
let _ = address1.broadcast(());
address1.is_connected();
address1.is_empty();
let _ = address1.same_actor(&address2);
}
#[allow(dead_code)] // The mere existence of this function already ensures that these public APIs exist, which is what we want to test!
fn converting_address_to_either_rc(address1: Address)
where
A: Actor,
Rc: RefCounter + Into,
A: Handler<(), Return = ()>,
{
address1.as_either();
}