pub struct NoQueue;Expand description
A no-op queue implementation used for phantom inputs and outputs.
NoQueue acts as a placeholder in the graph where a queue is required by
type but no actual buffering or message transfer is desired. All enqueue
attempts are rejected, and all dequeue or peek attempts return empty.
This is primarily useful for:
- Phantom or unconnected ports in a graph.
- Simplifying generic code that expects a queue type, without allocating unnecessary resources.
- Static analysis or testing scenarios where message flow is disabled.
§Type Parameters
P: Payload type of theMessagecarried by this queue.
§Behavior
Edge::try_pushalways returnsEnqueueResult::Rejected.Edge::try_popalways returnsQueueError::Empty.Edge::try_peekalways returnsQueueError::Empty.Edge::occupancyalways reports zero items, zero bytes, andWatermarkState::AtOrAboveHard(fully saturated, disallowing admission).
Trait Implementations§
Source§impl Edge for NoQueue
impl Edge for NoQueue
Source§fn try_push<H: HeaderStore>(
&mut self,
_token: MessageToken,
_policy: &EdgePolicy,
_headers: &H,
) -> EnqueueResult
fn try_push<H: HeaderStore>( &mut self, _token: MessageToken, _policy: &EdgePolicy, _headers: &H, ) -> EnqueueResult
Attempt to push a token onto the queue using the given edge policy. Read more
Source§fn try_pop<H: HeaderStore>(
&mut self,
_headers: &H,
) -> Result<MessageToken, QueueError>
fn try_pop<H: HeaderStore>( &mut self, _headers: &H, ) -> Result<MessageToken, QueueError>
Attempt to pop the front token from the queue. Read more
Source§fn occupancy(&self, _policy: &EdgePolicy) -> EdgeOccupancy
fn occupancy(&self, _policy: &EdgePolicy) -> EdgeOccupancy
Return a snapshot of occupancy used for telemetry and admission. Read more
Source§fn try_peek(&self) -> Result<MessageToken, QueueError>
fn try_peek(&self) -> Result<MessageToken, QueueError>
Peek at the front token without removing it.
Source§fn try_peek_at(&self, _index: usize) -> Result<MessageToken, QueueError>
fn try_peek_at(&self, _index: usize) -> Result<MessageToken, QueueError>
Peek at the token at logical position
index from the front. Read moreSource§fn try_pop_batch<H: HeaderStore>(
&mut self,
_policy: &BatchingPolicy,
_headers: &H,
) -> Result<BatchView<'_, MessageToken>, QueueError>
fn try_pop_batch<H: HeaderStore>( &mut self, _policy: &BatchingPolicy, _headers: &H, ) -> Result<BatchView<'_, MessageToken>, QueueError>
Pop a batch of tokens according to the provided batching policy. Read more
Source§fn peek_header<'h, H: HeaderStore>(
&self,
headers: &'h H,
) -> Result<<H as HeaderStore>::HeaderGuard<'h>, QueueError>
fn peek_header<'h, H: HeaderStore>( &self, headers: &'h H, ) -> Result<<H as HeaderStore>::HeaderGuard<'h>, QueueError>
Peek the front message header via
HeaderStore (convenience). Read moreSource§fn get_admission_decision<H: HeaderStore>(
&self,
policy: &EdgePolicy,
token: MessageToken,
headers: &H,
) -> AdmissionDecision
fn get_admission_decision<H: HeaderStore>( &self, policy: &EdgePolicy, token: MessageToken, headers: &H, ) -> AdmissionDecision
Return an
AdmissionDecision for the given token according to
policy and the current occupancy snapshot. Read moreSource§fn get_admission_decision_from_message<P: Payload>(
&self,
policy: &EdgePolicy,
message: &Message<P>,
) -> AdmissionDecision
fn get_admission_decision_from_message<P: Payload>( &self, policy: &EdgePolicy, message: &Message<P>, ) -> AdmissionDecision
Return an
AdmissionDecision for the given token according to
policy and the current occupancy snapshot. Read moreAuto Trait Implementations§
impl Freeze for NoQueue
impl RefUnwindSafe for NoQueue
impl Send for NoQueue
impl Sync for NoQueue
impl Unpin for NoQueue
impl UnsafeUnpin for NoQueue
impl UnwindSafe for NoQueue
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