Skip to content

Commit

Permalink
fix: remove Port enum from crate-public API
Browse files Browse the repository at this point in the history
  • Loading branch information
dadada committed Jun 21, 2024
1 parent 134aa67 commit 397e284
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
8 changes: 0 additions & 8 deletions a653rs-router/src/ports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ use crate::{
router::{RouterInput, RouterOutput},
};

#[derive(Debug)]
pub(crate) enum Port<H: ApexQueuingPortP4 + ApexSamplingPortP4> {
SamplingIn(SamplingPortDestination<H>),
SamplingOut(SamplingPortSource<H>),
QueuingIn(QueuingPortReceiver<H>),
QueuingOut(QueuingPortSender<H>),
}

impl<S: ApexSamplingPortP4> RouterInput for SamplingPortDestination<S> {
fn receive<'a>(&self, buf: &'a mut [u8]) -> Result<&'a [u8], PortError> {
router_bench!(begin_apex_receive, self.id() as u16);
Expand Down
15 changes: 13 additions & 2 deletions a653rs-router/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,30 @@ use crate::{
},
error::Error,
network::{CreateNetworkInterface, NetworkInterface, PayloadSize, PlatformNetworkInterface},
ports::{Port, PortError},
ports::PortError,
prelude::InterfaceName,
scheduler::{DeadlineRrScheduler, ScheduleError, Scheduler, TimeSource},
types::VirtualLinkId,
};

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<H: ApexQueuingPortP4 + ApexSamplingPortP4> {
SamplingIn(SamplingPortDestination<H>),
SamplingOut(SamplingPortSource<H>),
QueuingIn(QueuingPortReceiver<H>),
QueuingOut(QueuingPortSender<H>),
}

/// Router resources
#[derive(Debug)]
pub struct RouterResources<H, P, const IFS: usize, const PORTS: usize>
Expand Down

0 comments on commit 397e284

Please sign in to comment.