pub struct PeerRpcValidator { /* private fields */ }Expand description
Stateful validator for peer identity, protocol, expiry, integrity, and replay.
Implementations§
Source§impl PeerRpcValidator
impl PeerRpcValidator
Sourcepub fn new(config: PeerRpcValidationConfig) -> Self
pub fn new(config: PeerRpcValidationConfig) -> Self
Creates a validator using the default protocol version.
Sourcepub fn with_protocol_version(self, protocol_version: ProtocolVersion) -> Self
pub fn with_protocol_version(self, protocol_version: ProtocolVersion) -> Self
Sets the protocol version accepted by this host.
Sourcepub fn with_nonce_store(self, nonce_store: Arc<dyn PeerNonceStore>) -> Self
pub fn with_nonce_store(self, nonce_store: Arc<dyn PeerNonceStore>) -> Self
Replaces process-local replay tracking with a deployment-selected store.
Sourcepub fn validate(
&self,
envelope: &PeerRpcEnvelope,
now_ms: u64,
) -> Result<(), PeerRpcError>
pub fn validate( &self, envelope: &PeerRpcEnvelope, now_ms: u64, ) -> Result<(), PeerRpcError>
Validates an envelope and records its nonce to prevent replay.
Trait Implementations§
Source§impl Clone for PeerRpcValidator
impl Clone for PeerRpcValidator
Source§fn clone(&self) -> PeerRpcValidator
fn clone(&self) -> PeerRpcValidator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PeerRpcValidator
impl !UnwindSafe for PeerRpcValidator
impl Freeze for PeerRpcValidator
impl Send for PeerRpcValidator
impl Sync for PeerRpcValidator
impl Unpin for PeerRpcValidator
impl UnsafeUnpin for PeerRpcValidator
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