Skip to main content

QueryPolicy

Struct QueryPolicy 

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

Immutable parser and execution policy.

Implementations§

Source§

impl QueryPolicy

Source

pub fn for_each_codec_binding<E>( &self, callback: impl FnMut(&'static FieldMeta, &dyn Codec), ) -> Result<(), ParamError>
where E: SearchEntity,

Iterates the codecs that are actually bound to an entity’s result fields. The binding list is validated and cached per policy/entity.

Source

pub fn codec_for<E>(&self, field: &FieldMeta) -> Option<&dyn Codec>
where E: SearchEntity,

Source§

impl QueryPolicy

Source

pub fn new( names: ParamNames, limits: QueryLimits, ) -> Result<QueryPolicy, ConfigError>

Source

pub fn with_hard_limits( names: ParamNames, limits: QueryLimits, hard_limits: QueryHardLimits, ) -> Result<QueryPolicy, ConfigError>

Builds a policy with explicitly elevated hard limits.

Source

pub fn bean_searcher_4812() -> QueryPolicy

Source

pub fn with_cursor_codec(self, codec: CursorCodec) -> QueryPolicy

Source

pub fn with_raw_param_filter<F>(self, filter: F) -> QueryPolicy
where F: RawParamFilter + 'static,

Appends a server-owned parameter normalization step.

Source

pub fn with_codec<C>(self, codec: C) -> QueryPolicy
where C: Codec + 'static,

Appends a named input/result codec.

Source

pub fn with_custom_operator( self, operator: CustomOperator, input_type: ValueType, ) -> Result<QueryPolicy, ConfigError>

Registers one typed HTTP operator. Aliases cannot shadow builtins.

Source

pub fn with_server_sql_extension<E>( self, extension: ServerSqlExtension, ) -> Result<QueryPolicy, ConfigError>
where E: SearchEntity,

Registers a server-owned SQL extension and verifies its generated field whitelist against an entity before it can be exposed to HTTP.

Source

pub fn with_server_sql_registry<E>( self, registry: &ServerSqlRegistry, ) -> Result<QueryPolicy, ConfigError>
where E: SearchEntity,

Registers every bounded, server-owned SQL extension in a registry for one entity. The registry itself contains no request data and is expected to be constructed during application startup.

Source

pub fn registered_operator(&self, name: &str) -> Option<&RegisteredOperator>

Source

pub fn names(&self) -> &ParamNames

Source

pub fn with_param_names( self, names: ParamNames, ) -> Result<QueryPolicy, ConfigError>

Copies the policy for a remote endpoint with different control names.

Source

pub fn limits(&self) -> &QueryLimits

Source

pub fn hard_limits(&self) -> &QueryHardLimits

Source

pub const fn fingerprint(&self) -> u64

Source

pub const fn compatibility(&self) -> CompatibilityPolicy

Source

pub fn cursor_codec(&self) -> Option<&CursorCodec>

Trait Implementations§

Source§

impl Clone for QueryPolicy

Source§

fn clone(&self) -> QueryPolicy

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 Debug for QueryPolicy

Source§

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

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

impl Default for QueryPolicy

Source§

fn default() -> QueryPolicy

Returns the “default value” for a type. 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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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<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