Skip to main content

QueryLimits

Struct QueryLimits 

Source
pub struct QueryLimits {
    pub codec: CodecLimits,
    pub structural: StructuralLimits,
    pub remote_request_bytes: usize,
}
Expand description

The complete set of ceilings applied to one query session’s plans.

Every query-path limit is a field here; nothing on that path reads a constant. Self::CANONICAL reproduces the released fixed ceilings. A value from a session, an advertisement, or an embedding host is untrusted until Self::validate accepts it.

Fields§

§codec: CodecLimits

Canonical JSON ceilings for one plan or invocation artifact.

§structural: StructuralLimits

Typed-plan structural ceilings.

§remote_request_bytes: usize

Maximum bytes in one remote request envelope.

Reply size is not a query limit: it belongs to the caller’s answer budget and the executor’s answer ceilings.

Implementations§

Source§

impl QueryLimits

Source

pub const FIELDS: &'static [&'static str]

Stable names of every limit, in declaration order.

Source

pub fn get(&self, name: &str) -> Option<usize>

Return the limit with this stable name.

Source

pub fn set(&mut self, name: &str, value: usize) -> bool

Replace the limit with this stable name.

Returns false and changes nothing for an unknown name. The result is unvalidated until Self::validate accepts it.

Source

pub fn supported_maximum(name: &str) -> Option<usize>

Return the largest value the implementation supports for the limit with this stable name.

Source§

impl QueryLimits

Source

pub const CANONICAL: QueryLimits

The released fixed ceilings.

Source

pub fn validate(self) -> Result<QueryLimits, QueryLimitsError>

Admit one untrusted limits value.

Every limit must be at least one and no larger than the implementation supports. Bounds the implementation does not have are not invented here: byte and count ceilings are otherwise free.

Source

pub fn from_overrides<'name>( overrides: impl IntoIterator<Item = (&'name str, u64)>, ) -> Result<QueryLimits, QueryLimitsError>

Build validated limits from named overrides of the canonical defaults.

This is the one entry point for limits that arrive as untrusted name/value pairs: a host configuration, a language binding, or a server file. A limit that is not named keeps its default.

Source

pub fn min(self, other: QueryLimits) -> QueryLimits

Return the stricter of two limits, field by field.

Source

pub const fn remote_request_codec(self) -> CodecLimits

Codec limits for one remote request envelope.

A request embeds an independently canonical plan beneath exactly one framing object, hence the extra level.

Source

pub const fn invocation_bytes(self) -> usize

Maximum canonical bytes in one complete plan-bound invocation.

The owning wire object adds 234 fixed bytes around the input-row batch; see MAX_QUERY_INVOCATION_BYTES.

Source§

impl QueryLimits

Source

pub fn source_of(&self, name: &str) -> &'static str

Return whether the named limit is still at its released default.

The answer is the source detail of a diagnostic raised against that limit. A caller that merged in advertised limits overrides it with LIMIT_SOURCE_ADVERTISED where the advertisement is binding.

Source

pub fn annotate(self, diagnostic: Diagnostic) -> Diagnostic

Name the limit a resource-limit diagnostic was raised against.

Adds limit, maximum, and source details to a query resource-limit diagnostic that does not carry them yet. Any other diagnostic is returned unchanged.

Source

pub fn annotate_refusal(diagnostic: Diagnostic, maximum: usize) -> Diagnostic

Annotate a refusal raised by a stage that holds only the one ceiling it checked, such as a binding bounding a foreign sequence before it materializes it.

maximum is the ceiling that stage enforced. source is derived by comparing it with the canonical default of the limit the code names.

Source

pub fn annotate_negotiated( self, configured: QueryLimits, diagnostic: Diagnostic, ) -> Diagnostic

Self::annotate for limits merged from a caller’s own and an executor’s advertisement.

self is the merged value. Where the advertisement is the stricter side for the refused limit, source says so: raising the caller’s own setting would not help.

Source

pub fn mark_advertised( self, configured: QueryLimits, diagnostic: Diagnostic, ) -> Diagnostic

Set source to advertised on an annotated refusal whose limit the advertisement tightened below the caller’s own value.

Source

pub fn annotate_limit( self, diagnostic: Diagnostic, limit: &'static str, ) -> Diagnostic

Self::annotate for a diagnostic whose limit the caller knows better than the code table, such as a codec failure of an envelope.

Trait Implementations§

Source§

impl Clone for QueryLimits

Source§

fn clone(&self) -> QueryLimits

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for QueryLimits

Source§

impl Debug for QueryLimits

Source§

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

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

impl Default for QueryLimits

Source§

fn default() -> QueryLimits

Returns the “default value” for a type. Read more
Source§

impl Eq for QueryLimits

Source§

impl PartialEq for QueryLimits

Source§

fn eq(&self, other: &QueryLimits) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for QueryLimits

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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