QueryParamLimiter

Trait QueryParamLimiter 

Source
pub trait QueryParamLimiter {
    const PARAM_NAME: &'static str;
    const LIMIT: usize;

    // Provided method
    fn check(size: usize) -> Result<(), QueryLimitError> { ... }
}
Expand description

Checks limits against the desired query parameters, per query parameter and bails if they exceed a defined value.

Required Associated Constants§

Source

const PARAM_NAME: &'static str

Name of the parameter to mention in the error.

Source

const LIMIT: usize

Limit that causes a bail if exceeded.

Provided Methods§

Source

fn check(size: usize) -> Result<(), QueryLimitError>

Do the actual check.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl QueryParamLimiter for QueryParamAccountIdLimit

Source§

const PARAM_NAME: &str = "account_id"

Source§

const LIMIT: usize = GENERAL_REQUEST_LIMIT

Source§

impl QueryParamLimiter for QueryParamBlockLimit

Source§

const PARAM_NAME: &str = "block_header"

Source§

const LIMIT: usize = GENERAL_REQUEST_LIMIT

Source§

impl QueryParamLimiter for QueryParamNoteCommitmentLimit

Source§

const PARAM_NAME: &str = "note_commitment"

Source§

const LIMIT: usize = GENERAL_REQUEST_LIMIT

Source§

impl QueryParamLimiter for QueryParamNoteIdLimit

Source§

const PARAM_NAME: &str = "note_id"

Source§

const LIMIT: usize = 100

Source§

impl QueryParamLimiter for QueryParamNoteTagLimit

Source§

const PARAM_NAME: &str = "note_tag"

Source§

const LIMIT: usize = GENERAL_REQUEST_LIMIT

Source§

impl QueryParamLimiter for QueryParamNullifierLimit

Source§

const PARAM_NAME: &str = "nullifier"

Source§

const LIMIT: usize = GENERAL_REQUEST_LIMIT

Source§

impl QueryParamLimiter for QueryParamNullifierPrefixLimit

Source§

const PARAM_NAME: &str = "nullifier_prefix"

Source§

const LIMIT: usize = GENERAL_REQUEST_LIMIT

Source§

impl QueryParamLimiter for QueryParamStorageMapKeyTotalLimit

Source§

const PARAM_NAME: &str = "storage_map_key"

Source§

const LIMIT: usize = 64