pub struct RpcResponsePacketTx;Expand description
The encoder for an outbound RPC response.
RpcResponsePacketTx is a type-level tag — its sole associated function, encode,
assembles the wire response given the server’s identity fields, the pow_content_hash
from the corresponding request, and a payload. The server signs
hash(pow_content_hash_salt || pow_content_hash) with its SignatureKey, using a fresh
random salt it chooses itself (never the raw caller-chosen hash — see the module docs),
and emits the signature and salt on the response so
the caller can prove the response was produced by the intended destination peer for
this specific request — a defence against both response substitution and replayed
responses.
Paired with RpcResponsePacketRx on the decode side.
Implementations§
Source§impl RpcResponsePacketTx
impl RpcResponsePacketTx
pub fn encode( server_id_signature_key: &SignatureKey, server_id_verification_key_bytes: &VerificationKeyBytes, server_id_pq_commitment_bytes: &PQCommitmentBytes, server_id_verification_sponsor_id: &Id, server_id_timestamp: &TimeMillis, server_id_hash: &Hash, server_id_salt: &Salt, pow_content_hash: &Hash, flags: RpcResponsePacketTxFlags, payload_response_kind: PayloadResponseKind, payload_uncompressed: BytesGatherer, ) -> Result<BytesGatherer>
Auto Trait Implementations§
impl Freeze for RpcResponsePacketTx
impl RefUnwindSafe for RpcResponsePacketTx
impl Send for RpcResponsePacketTx
impl Sync for RpcResponsePacketTx
impl Unpin for RpcResponsePacketTx
impl UnsafeUnpin for RpcResponsePacketTx
impl UnwindSafe for RpcResponsePacketTx
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