pub struct BudgetSpec {
pub max_records: Option<u64>,
pub max_bytes: Option<u64>,
pub max_duration_secs: Option<u64>,
pub allowed_sinks: Vec<String>,
}Expand description
A run budget.
Fields§
§max_records: Option<u64>Most records the sink may accept. A page that would cross it is
refused whole and the run fails with budget_exceeded.
max_bytes: Option<u64>Most estimated serialized bytes the sink may accept (same estimate as usage accounting). Refused whole at the page that would cross it.
max_duration_secs: Option<u64>Longest an invocation may run. Past it the run is cancelled
cooperatively (stops at the next page boundary, flushes) and fails
with budget_exceeded.
allowed_sinks: Vec<String>Sink template names (pipeline.sinks.* keys) and/or connector kinds a
row may write to. Empty = any. Checked before anything runs.
Implementations§
Source§impl BudgetSpec
impl BudgetSpec
Sourcepub const DENY_ALL_SINKS: &'static str = "!none"
pub const DENY_ALL_SINKS: &'static str = "!none"
The allowed_sinks entry a merge leaves when two non-empty lists have
nothing in common: it matches no sink, so every row is refused.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Every ceiling must be positive; an empty allowed_sinks entry is a
typo.
Sourcepub fn merge(&self, other: &BudgetSpec) -> BudgetSpec
pub fn merge(&self, other: &BudgetSpec) -> BudgetSpec
The stricter of two budgets: the lower of each ceiling, and the
intersection of the allowed-sink lists (either side’s list alone when
only one names any). Two lists with nothing in common allow no sink
(Self::DENY_ALL_SINKS) — an empty list would mean “any”.
Sourcepub fn merge_with(
&self,
other: &BudgetSpec,
kind_of: &dyn Fn(&str) -> Option<String>,
) -> BudgetSpec
pub fn merge_with( &self, other: &BudgetSpec, kind_of: &dyn Fn(&str) -> Option<String>, ) -> BudgetSpec
Self::merge, where kind_of names the connector kind of a sink
template: a template on one side survives when the other side allows
its kind.
Sourcepub fn sink_allowed(&self, sink_ref: &str, kind: &str) -> bool
pub fn sink_allowed(&self, sink_ref: &str, kind: &str) -> bool
Whether a row writing to sink template sink_ref of connector kind
is allowed.
Trait Implementations§
Source§impl Clone for BudgetSpec
impl Clone for BudgetSpec
Source§impl Debug for BudgetSpec
impl Debug for BudgetSpec
Source§impl Default for BudgetSpec
impl Default for BudgetSpec
Source§impl<'de> Deserialize<'de> for BudgetSpec
impl<'de> Deserialize<'de> for BudgetSpec
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 BudgetSpec
Source§impl JsonSchema for BudgetSpec
impl JsonSchema for BudgetSpec
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for BudgetSpec
impl PartialEq for BudgetSpec
Source§impl Serialize for BudgetSpec
impl Serialize for BudgetSpec
impl StructuralPartialEq for BudgetSpec
Auto Trait Implementations§
impl Freeze for BudgetSpec
impl RefUnwindSafe for BudgetSpec
impl Send for BudgetSpec
impl Sync for BudgetSpec
impl Unpin for BudgetSpec
impl UnsafeUnpin for BudgetSpec
impl UnwindSafe for BudgetSpec
Blanket Implementations§
impl<T> Allocation for T
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
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§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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request