pub struct ValidationMiddleware { /* private fields */ }Expand description
Validation middleware for message schema validation with improved error handling and performance
Implementations§
Source§impl ValidationMiddleware
impl ValidationMiddleware
pub fn new() -> ValidationMiddleware
pub fn strict() -> ValidationMiddleware
pub fn with_allowed_methods(self, methods: Vec<String>) -> ValidationMiddleware
pub fn with_max_message_size(self, size: usize) -> ValidationMiddleware
pub fn with_max_params_depth(self, depth: usize) -> ValidationMiddleware
Trait Implementations§
Source§impl Default for ValidationMiddleware
impl Default for ValidationMiddleware
Source§fn default() -> ValidationMiddleware
fn default() -> ValidationMiddleware
Returns the “default value” for a type. Read more
Source§impl TransportMiddleware for ValidationMiddleware
impl TransportMiddleware for ValidationMiddleware
Source§fn process_outgoing<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ValidationMiddleware: 'async_trait,
fn process_outgoing<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ValidationMiddleware: 'async_trait,
Process outgoing message
Source§fn process_incoming<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ValidationMiddleware: 'async_trait,
fn process_incoming<'life0, 'life1, 'async_trait>(
&'life0 self,
message: &'life1 mut JsonRpcMessage,
) -> Pin<Box<dyn Future<Output = Result<(), TransportError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
ValidationMiddleware: 'async_trait,
Process incoming message
Auto Trait Implementations§
impl Freeze for ValidationMiddleware
impl RefUnwindSafe for ValidationMiddleware
impl Send for ValidationMiddleware
impl Sync for ValidationMiddleware
impl Unpin for ValidationMiddleware
impl UnwindSafe for ValidationMiddleware
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