From 397e28485a49a4c9fb8c07efc6331e65b3b20dcc Mon Sep 17 00:00:00 2001 From: Tim Schubert Date: Fri, 21 Jun 2024 08:53:31 +0200 Subject: [PATCH] fix: remove Port enum from crate-public API --- a653rs-router/src/ports.rs | 8 -------- a653rs-router/src/router.rs | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/a653rs-router/src/ports.rs b/a653rs-router/src/ports.rs index 2c4b757..c4685ff 100644 --- a/a653rs-router/src/ports.rs +++ b/a653rs-router/src/ports.rs @@ -6,14 +6,6 @@ use crate::{ router::{RouterInput, RouterOutput}, }; -#[derive(Debug)] -pub(crate) enum Port { - SamplingIn(SamplingPortDestination), - SamplingOut(SamplingPortSource), - QueuingIn(QueuingPortReceiver), - QueuingOut(QueuingPortSender), -} - impl RouterInput for SamplingPortDestination { fn receive<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], PortError> { router_bench!(begin_apex_receive, self.id() as u16); diff --git a/a653rs-router/src/router.rs b/a653rs-router/src/router.rs index 52370c9..62c3960 100644 --- a/a653rs-router/src/router.rs +++ b/a653rs-router/src/router.rs @@ -6,7 +6,7 @@ use crate::{ }, error::Error, network::{CreateNetworkInterface, NetworkInterface, PayloadSize, PlatformNetworkInterface}, - ports::{Port, PortError}, + ports::PortError, prelude::InterfaceName, scheduler::{DeadlineRrScheduler, ScheduleError, Scheduler, TimeSource}, types::VirtualLinkId, @@ -14,11 +14,22 @@ use crate::{ use a653rs::{ bindings::{ApexQueuingPortP4, ApexSamplingPortP4}, - prelude::StartContext, + prelude::{ + QueuingPortReceiver, QueuingPortSender, SamplingPortDestination, SamplingPortSource, + StartContext, + }, }; use core::{fmt::Debug, marker::PhantomData, ops::Deref, str::FromStr, time::Duration}; use heapless::{FnvIndexMap, LinearMap, Vec}; +#[derive(Debug)] +enum Port { + SamplingIn(SamplingPortDestination), + SamplingOut(SamplingPortSource), + QueuingIn(QueuingPortReceiver), + QueuingOut(QueuingPortSender), +} + /// Router resources #[derive(Debug)] pub struct RouterResources