Skip to main content

TestCounterSourceTensor

Struct TestCounterSourceTensor 

Source
pub struct TestCounterSourceTensor<Clock, const BACKLOG_CAP: usize>
where Clock: PlatformClock,
{ /* private fields */ }
Expand description

A test source that:

  • Produces an incrementing counter encoded into a TestTensor on each try_produce().
  • Exposes ingress pressure via either an internal backlog or a std probe.

Implementations§

Source§

impl<Clock, const BACKLOG_CAP: usize> TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: PlatformClock,

Source

pub const fn new( clock: Clock, starting_value_inclusive: u32, trace_id: TraceId, starting_sequence: SequenceNumber, deadline_ns: Option<DeadlineNs>, qos: QoSClass, flags: MessageFlags, node_capabilities: NodeCapabilities, node_policy: NodePolicy, output_placement_acceptance: [PlacementAcceptance; 1], ingress_policy: EdgePolicy, ) -> Self

Create a new tensor-producing test source.

Source

pub fn with_probe( self, probe: SourceIngressProbe, updater: SourceIngressUpdater, ) -> Self

Attach a std ingress probe + updater (authoritative for occupancy when present).

Source

pub fn produce_n_items_in_backlog(&mut self, n: usize)

Set a synthetic upstream backlog (items).

Trait Implementations§

Source§

impl<Clock, const BACKLOG_CAP: usize> Source<Tensor<u32, TEST_TENSOR_ELEMENT_COUNT, 2>, 1> for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: PlatformClock,

Source§

fn peek_ingress_creation_tick(&self, item_index: usize) -> Option<u64>

Peek the creation tick of the item_index’th ingress item (0 = oldest). Non-blocking and non-destructive. Returns None if metadata is not available (no backlog) or item_index is out of range.

Source§

type Error = Infallible

Source-specific error type for open().
Source§

fn open(&mut self) -> Result<(), Self::Error>

Prepare the source for production (e.g., open device, init driver). Read more
Source§

fn try_produce(&mut self) -> Option<(usize, Message<TestTensor>)>

Attempt to produce exactly one (port, message) pair. Read more
Source§

fn ingress_occupancy(&self) -> EdgeOccupancy

Report ingress pressure (items/bytes before the source). Read more
Source§

fn output_acceptance(&self) -> [PlacementAcceptance; 1]

Return output placement acceptances for zero-copy compatibility.
Source§

fn capabilities(&self) -> NodeCapabilities

Describe source capabilities (device streams, degrade tiers, etc.).
Source§

fn policy(&self) -> NodePolicy

Provide the node policy bundle (batching/budget/deadlines).
Source§

fn ingress_policy(&self) -> EdgePolicy

Provude the ingress edge policy for this source node.
Source§

fn into_sourcenode(self, policy: NodePolicy) -> SourceNode<Self, OutP, OUT>
where Self: Sized,

Convenience: wrap this source in a SourceNode with the provided policy. Read more

Auto Trait Implementations§

§

impl<Clock, const BACKLOG_CAP: usize> Freeze for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: Freeze,

§

impl<Clock, const BACKLOG_CAP: usize> RefUnwindSafe for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: RefUnwindSafe,

§

impl<Clock, const BACKLOG_CAP: usize> Send for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: Send,

§

impl<Clock, const BACKLOG_CAP: usize> Sync for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: Sync,

§

impl<Clock, const BACKLOG_CAP: usize> Unpin for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: Unpin,

§

impl<Clock, const BACKLOG_CAP: usize> UnsafeUnpin for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: UnsafeUnpin,

§

impl<Clock, const BACKLOG_CAP: usize> UnwindSafe for TestCounterSourceTensor<Clock, BACKLOG_CAP>
where Clock: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.