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
TestTensoron eachtry_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,
impl<Clock, const BACKLOG_CAP: usize> TestCounterSourceTensor<Clock, BACKLOG_CAP>where
Clock: PlatformClock,
Sourcepub 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
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.
Sourcepub fn with_probe(
self,
probe: SourceIngressProbe,
updater: SourceIngressUpdater,
) -> Self
pub fn with_probe( self, probe: SourceIngressProbe, updater: SourceIngressUpdater, ) -> Self
Attach a std ingress probe + updater (authoritative for occupancy when present).
Sourcepub fn produce_n_items_in_backlog(&mut self, n: usize)
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,
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>
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
type Error = Infallible
Source-specific error type for
open().Source§fn open(&mut self) -> Result<(), Self::Error>
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>)>
fn try_produce(&mut self) -> Option<(usize, Message<TestTensor>)>
Attempt to produce exactly one
(port, message) pair. Read moreSource§fn ingress_occupancy(&self) -> EdgeOccupancy
fn ingress_occupancy(&self) -> EdgeOccupancy
Report ingress pressure (items/bytes before the source). Read more
Source§fn output_acceptance(&self) -> [PlacementAcceptance; 1]
fn output_acceptance(&self) -> [PlacementAcceptance; 1]
Return output placement acceptances for zero-copy compatibility.
Source§fn capabilities(&self) -> NodeCapabilities
fn capabilities(&self) -> NodeCapabilities
Describe source capabilities (device streams, degrade tiers, etc.).
Source§fn policy(&self) -> NodePolicy
fn policy(&self) -> NodePolicy
Provide the node policy bundle (batching/budget/deadlines).
Source§fn ingress_policy(&self) -> EdgePolicy
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,
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 moreAuto 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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more