#[repr(C)]pub struct SignedInvocation {
pub tool_id: u32,
pub nonce: u64,
pub timestamp: u64,
pub args_hash: [u8; 32],
pub signature: [u8; 64],
}Expand description
Signed invocation with replay protection
Fields§
§tool_id: u32Tool identifier
nonce: u64Unique nonce for replay protection
timestamp: u64Timestamp for expiration
args_hash: [u8; 32]Blake3 hash of arguments
signature: [u8; 64]Ed25519 signature
Implementations§
Source§impl SignedInvocation
impl SignedInvocation
Sourcepub const SIGNED_BYTES_SIZE: usize = 52
pub const SIGNED_BYTES_SIZE: usize = 52
Size of the compact payload covered by the signature.
Sourcepub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, DCPError>
pub fn from_bytes(bytes: impl AsRef<[u8]>) -> Result<Self, DCPError>
Parse from canonical bytes.
Sourcepub fn signed_bytes(&self) -> [u8; 52]
pub fn signed_bytes(&self) -> [u8; 52]
Get the compact bytes covered by the signature.
Trait Implementations§
Source§impl Clone for SignedInvocation
impl Clone for SignedInvocation
Source§fn clone(&self) -> SignedInvocation
fn clone(&self) -> SignedInvocation
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 moreimpl Copy for SignedInvocation
Source§impl Debug for SignedInvocation
impl Debug for SignedInvocation
impl Eq for SignedInvocation
Source§impl PartialEq for SignedInvocation
impl PartialEq for SignedInvocation
Source§fn eq(&self, other: &SignedInvocation) -> bool
fn eq(&self, other: &SignedInvocation) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SignedInvocation
Auto Trait Implementations§
impl Freeze for SignedInvocation
impl RefUnwindSafe for SignedInvocation
impl Send for SignedInvocation
impl Sync for SignedInvocation
impl Unpin for SignedInvocation
impl UnsafeUnpin for SignedInvocation
impl UnwindSafe for SignedInvocation
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