use crate::core::io::{BroadcastScope, ConnectionInfo};
use crate::core::utils::Sealed;
use crate::protocol::{FrameProcessor, Unset};
use crate::prelude::*;
pub trait NodeApiInternal<V: MaybeVersioned>: Sealed {
fn info(&self) -> &ConnectionInfo;
unsafe fn route_frame_internal(&self, frame: Frame<V>, scope: BroadcastScope) -> Result<()>;
fn processor_internal(&self) -> &FrameProcessor;
}
pub trait NodeApi<V: MaybeVersioned>: NodeApiInternal<V> {}
impl<V: MaybeVersioned> NodeApiInternal<V> for Unset {
fn info(&self) -> &ConnectionInfo {
ConnectionInfo::unknown()
}
unsafe fn route_frame_internal(&self, _: Frame<V>, _: BroadcastScope) -> Result<()> {
unreachable!()
}
fn processor_internal(&self) -> &FrameProcessor {
unreachable!()
}
}
impl<V: MaybeVersioned> NodeApi<V> for Unset {}