pub struct PrivateEventFilterValidator { /* private fields */ }Expand description
Validates and sanitizes private event filters.
Ensures block ranges are valid and within the anchor block boundary.
Implementations§
Source§impl PrivateEventFilterValidator
impl PrivateEventFilterValidator
pub fn new(anchor_block_number: u64) -> PrivateEventFilterValidator
Sourcepub fn validate(
&self,
filter: &PrivateEventFilter,
) -> Result<PrivateEventQueryFilter, Error>
pub fn validate( &self, filter: &PrivateEventFilter, ) -> Result<PrivateEventQueryFilter, Error>
Validate and convert a PrivateEventFilter to a PrivateEventQueryFilter.
Validation rules (matching upstream TS implementation):
- At least one scope is required
from_blockdefaults to 1 (genesis), clamped to at least 1to_blockdefaults to anchor_block_number + 1 (exclusive upper bound)to_blockmust not exceed anchor_block_number + 1 (rejects, not clamps)from_blockmust be less thanto_block
Auto Trait Implementations§
impl Freeze for PrivateEventFilterValidator
impl RefUnwindSafe for PrivateEventFilterValidator
impl Send for PrivateEventFilterValidator
impl Sync for PrivateEventFilterValidator
impl Unpin for PrivateEventFilterValidator
impl UnwindSafe for PrivateEventFilterValidator
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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