Skip to main content

FilterLimitsBuilder

Struct FilterLimitsBuilder 

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

Fluent builder for validated filter limits.

§Examples

use qubit_metadata::FilterLimits;

let limits = FilterLimits::builder().max_nodes(32).build()?;
assert_eq!(limits.max_nodes(), 32);

Implementations§

Source§

impl FilterLimitsBuilder

Source

pub const fn max_depth(self, max_depth: usize) -> Self

Sets the maximum nested expression depth.

§Parameters
  • max_depth - Requested root-inclusive expression depth.
§Returns

The updated builder.

Source

pub const fn max_nodes(self, max_nodes: usize) -> Self

Sets the maximum expression node count.

§Parameters
  • max_nodes - Requested count including constants and logical nodes.
§Returns

The updated builder.

Source

pub const fn max_set_values(self, max_set_values: usize) -> Self

Sets the maximum candidate count in one membership condition.

§Parameters
  • max_set_values - Requested candidate-value count.
§Returns

The updated builder.

Source

pub const fn max_key_bytes(self, max_key_bytes: usize) -> Self

Sets the maximum UTF-8 byte length of one metadata key.

§Parameters
  • max_key_bytes - Requested byte bound.
§Returns

The updated builder.

Source

pub fn build(self) -> MetadataResult<FilterLimits>

Builds validated resource limits.

§Errors

Returns a metadata error when a requested bound is zero or exceeds the library hard maximum.

§Returns

Limits using explicit values and hard maximums for unset properties.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoValueDefault<T> for T

Source§

fn into_value_default(self) -> T

Converts this argument into the default value. 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.