use roam_types::{Link, MessageFamily, MsgFamily};
use crate::BareConduit;
pub trait IntoConduit {
type Conduit;
fn into_conduit(self) -> Self::Conduit;
}
impl<L: Link> IntoConduit for L {
type Conduit = BareConduit<MessageFamily, L>;
fn into_conduit(self) -> Self::Conduit {
BareConduit::new(self)
}
}
impl<F: MsgFamily, L: Link> IntoConduit for BareConduit<F, L> {
type Conduit = BareConduit<F, L>;
fn into_conduit(self) -> Self::Conduit {
self
}
}
#[cfg(not(target_arch = "wasm32"))]
impl<F: MsgFamily, LS: crate::LinkSource> IntoConduit for crate::StableConduit<F, LS> {
type Conduit = crate::StableConduit<F, LS>;
fn into_conduit(self) -> Self::Conduit {
self
}
}