pub struct ODataLimits {
pub max_top: usize,
pub max_orderby_fields: usize,
pub max_filter_length: usize,
pub require_signed_cursors: bool,
pub cursor_hmac_key: Option<Vec<u8>>,
}Expand description
Default configuration for OData input limits
Fields§
§max_top: usizeMaximum value for $top (default: 1000)
max_orderby_fields: usizeMaximum number of fields in $orderby (default: 5)
max_filter_length: usizeMaximum length of $filter expression in characters (default: 2000)
require_signed_cursors: boolWhether to enforce HMAC signing on cursors (default: false for now)
cursor_hmac_key: Option<Vec<u8>>HMAC key for cursor signing (if enabled)
Implementations§
Source§impl ODataLimits
impl ODataLimits
Sourcepub fn with_max_top(self, max_top: usize) -> Self
pub fn with_max_top(self, max_top: usize) -> Self
Set maximum $top value
Sourcepub fn with_max_orderby_fields(self, max: usize) -> Self
pub fn with_max_orderby_fields(self, max: usize) -> Self
Set maximum number of $orderby fields
Sourcepub fn with_max_filter_length(self, max: usize) -> Self
pub fn with_max_filter_length(self, max: usize) -> Self
Set maximum $filter length
Sourcepub fn with_signed_cursors(self, key: Vec<u8>) -> Self
pub fn with_signed_cursors(self, key: Vec<u8>) -> Self
Enable HMAC-signed cursors with the given key
Sourcepub fn validate_top(&self, top: usize) -> Result<(), Error>
pub fn validate_top(&self, top: usize) -> Result<(), Error>
Validate a $top value against limits.
§Errors
Returns Error::InvalidLimit if the top value exceeds the maximum allowed.
Trait Implementations§
Source§impl Clone for ODataLimits
impl Clone for ODataLimits
Source§fn clone(&self) -> ODataLimits
fn clone(&self) -> ODataLimits
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ODataLimits
impl Debug for ODataLimits
Auto Trait Implementations§
impl Freeze for ODataLimits
impl RefUnwindSafe for ODataLimits
impl Send for ODataLimits
impl Sync for ODataLimits
impl Unpin for ODataLimits
impl UnsafeUnpin for ODataLimits
impl UnwindSafe for ODataLimits
Blanket Implementations§
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
Mutably borrows from an owned value. Read more