Skip to main content

ScriptedFeed

Struct ScriptedFeed 

Source
pub struct ScriptedFeed { /* private fields */ }
Expand description

A Feed whose deliveries, publish outcomes and call refusals are scripted by the paired FeedScript. Build both with scripted_feed.

receive hands out scripted deliveries in the order they were scripted. fail records the report and lets go of the delivery, and delivers nothing again on its own: the script decides what the feed does next. A call with a receipt the feed no longer holds returns Gone and is recorded by FeedScript::gone. A scripted refusal of that call is served before this check. Its backend key is scripted, so a pipeline it is passed to names scripted in its feed: section.

Trait Implementations§

Source§

impl Debug for ScriptedFeed

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Feed for ScriptedFeed

Source§

fn backend(&self) -> &str

The key that names this backend in a feed: section, such as "memory". The runtime refuses a feed whose key differs from the one the pipeline’s FeedSection names.
Source§

fn set_waker(&self, waker: FeedWaker)

Hand the backend the waker it signals when a unit becomes ready to receive, including one that arrived before this call, and after a receive that takes some units and leaves others. A receive that takes nothing sends no signal. Called before the first receive; a later call replaces the waker.
Source§

fn receive(&self, max: usize) -> Result<Vec<Delivery>, FeedError>

Up to max deliveries the backend has buffered, oldest first. Never waits; returns an empty list when nothing is ready. Read more
Source§

fn renew(&self, receipt: Receipt) -> Result<(), FeedError>

Mark a held unit as still in work. Read more
Source§

fn acknowledge(&self, receipt: Receipt) -> Result<(), FeedError>

Remove a unit from the feed as done. Only the ack rule decides when a caller may send it. Read more
Source§

fn fail(&self, receipt: Receipt, reason: &str) -> Result<(), FeedError>

Return a held unit that this reader could not process, so the feed delivers it again. At the feed’s delivery cap the unit moves to its dead-letter destination instead. reason is for the feed’s logs. Read more
Source§

fn publish(&self, unit: Unit) -> Confirmation ⓘ

Add a unit to the feed. The returned Confirmation resolves once the feed has stored the unit or refused it. A unit published twice is delivered twice.
Source§

fn read_depth(&self, of: DepthOf) -> Option<DepthReading>

Count what the feed, or its dead-letter destination, holds. The returned DepthReading settles once the backend has read the counts. Never waits. Read more
Source§

fn hands_back(&self) -> bool

Whether a stopping worker reads this feed’s units to the STOP_RESERVE and hands back the rest, as the module docs’ “Stopping” order describes. Startup refuses a drain timeout no longer than the reserve on a feed that answers true. The default returns false.
Source§

fn stop_receiving(&self)

Receive nothing more: the worker is stopping. Units already buffered are the backend’s to give back. The default does nothing.
Source§

fn hand_back(&self, receipt: Receipt) -> Result<(), FeedError>

Return a held unit for another reader to take at once. The delivery does not count as a failure; a backend that counts deliveries toward a dead-letter limit counts this one as it counts any delivery. Read more
Source§

fn close(&self, within: Duration) -> Option<Confirmation>

Send what the backend still has queued and give up every unit still held, within within. Called once, after the pipeline’s final commit. Never waits: the returned Confirmation settles when the backend is done, and a caller stops waiting for it after within. Read more
Source§

fn attach_metrics(&self, _cx: FeedMetricsCtx)

Receive the Meter and per-partition setting for the backend’s own metric families. Called before the source is handed the feed, once for each pipeline that runs it, with that pipeline’s labels and that pipeline’s metrics.per_partition_detail. Resolve handles here and keep them, which &self leaves to interior mutability. Read more

Auto Trait Implementations§

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more