pub struct BatchItem {
pub key: String,
pub input: Value,
pub label: Option<Label>,
}Expand description
One unit of work in a batch.
Fields§
§key: StringStable, unique within the batch, and ordered.
Ordering is what lets the cursor be a single value rather than a set of seen keys, which for 10⁵ items is the difference between a resume that reads one row and one that reads the whole batch. A meter number, a document id, or a zero-padded sequence all work; a random uuid does not, because “everything after this key” then means nothing.
input: ValueWhat the plan receives as run input for this item.
label: Option<Label>The input’s label, when the source vouches for one.
None — the default — admits the item untrusted, from the source
batch:<batch id>. A source reading a paged API, a file or somebody
else’s database is the normal case, and an item it produced is data
from outside the plane: trusted input would reach every mutating sink
and every protected field with no release on the record.
Implementations§
Source§impl BatchItem
impl BatchItem
Sourcepub fn new(key: impl Into<String>, input: Value) -> Self
pub fn new(key: impl Into<String>, input: Value) -> Self
An item admitted untrusted, from the source batch:<batch id>.
Sourcepub fn labelled(self, label: Label) -> Self
pub fn labelled(self, label: Label) -> Self
Admit this item under label instead.
The operator’s statement about where the source’s data came from,
journaled as the run’s input label. Label::trusted() is the one to
think about: it says the plane’s own operator produced this input, and
every taint gate downstream takes that at its word.
Sourcepub fn admission_label(&self, batch: BatchId) -> Label
pub fn admission_label(&self, batch: BatchId) -> Label
The label this item’s run is admitted under, in batch batch.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for BatchItem
impl<'de> Deserialize<'de> for BatchItem
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for BatchItem
impl StructuralPartialEq for BatchItem
Auto Trait Implementations§
impl Freeze for BatchItem
impl RefUnwindSafe for BatchItem
impl Send for BatchItem
impl Sync for BatchItem
impl Unpin for BatchItem
impl UnsafeUnpin for BatchItem
impl UnwindSafe for BatchItem
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more