use crate::{HostEntity, OwnedLocalEntity, RemoteEntity};
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
pub struct LocalEntity {
inner: OwnedLocalEntity,
}
impl LocalEntity {
fn new(inner: OwnedLocalEntity) -> Self {
Self { inner }
}
}
impl From<HostEntity> for LocalEntity {
fn from(entity: HostEntity) -> Self {
Self::from(entity.copy_to_owned())
}
}
impl From<RemoteEntity> for LocalEntity {
fn from(entity: RemoteEntity) -> Self {
Self::from(entity.copy_to_owned())
}
}
impl From<OwnedLocalEntity> for LocalEntity {
fn from(entity: OwnedLocalEntity) -> Self {
Self::new(entity)
}
}
impl From<LocalEntity> for OwnedLocalEntity {
fn from(val: LocalEntity) -> Self {
val.inner
}
}