use id_effect::Effect;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type Txn = id_effect::stm::Txn;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type Outcome<A, E> = id_effect::stm::Outcome<A, E>;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type Stm<A, E> = id_effect::stm::Stm<A, E>;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type TRef<A> = id_effect::stm::TRef<A>;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type TQueue<A> = id_effect::stm::TQueue<A>;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type TMap<K, V> = id_effect::stm::TMap<K, V>;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub type TSemaphore = id_effect::stm::TSemaphore;
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub fn commit<A, E, R>(stm: id_effect::stm::Stm<A, E>) -> Effect<A, E, R>
where
A: Send + 'static,
E: Send + 'static,
R: Send + Sync + 'static,
{
id_effect::stm::commit(stm)
}
#[deprecated(since = "0.11.0", note = "use id_effect::stm")]
pub fn atomically<A, E, R>(stm: id_effect::stm::Stm<A, E>) -> Effect<A, E, R>
where
A: Send + 'static,
E: Send + 'static,
R: Send + Sync + 'static,
{
id_effect::stm::atomically(stm)
}
#[cfg(test)]
#[allow(deprecated)]
mod tests {
use crate::test_support::run;
#[test]
fn deprecated_aliases_are_the_core_stm_items() {
let cell: crate::TRef<i32> = run(crate::commit(crate::TRef::make(1))).expect("make");
let core: id_effect::stm::TRef<i32> = cell.clone();
run(super::atomically(core.update_stm::<(), _>(|n| n + 1))).expect("update");
assert_eq!(run(id_effect::stm::commit(cell.read_stm::<()>())), Ok(2));
}
}