pub trait SignedGossipMessage: Serialize + for<'de> Deserialize<'de> {
// Required method
fn verify_signature(&self) -> Result<()>;
// Provided methods
fn to_wire_bytes(&self) -> Result<Vec<u8>> { ... }
fn from_wire_bytes(bytes: &[u8]) -> Result<Self> { ... }
}Expand description
Anything that can be signed, broadcast, and verified over gossip.
Required Methods§
Sourcefn verify_signature(&self) -> Result<()>
fn verify_signature(&self) -> Result<()>
Verify this message’s signature. Returns Ok(()) if valid.
Types that use bearer-capability auth (e.g. PrivateLink) may return
Ok(()) unconditionally and enforce auth at the application layer.
§Errors
Returns an error if the signature is missing, malformed, or invalid.
Provided Methods§
Sourcefn to_wire_bytes(&self) -> Result<Vec<u8>>
fn to_wire_bytes(&self) -> Result<Vec<u8>>
Sourcefn from_wire_bytes(bytes: &[u8]) -> Result<Self>
fn from_wire_bytes(bytes: &[u8]) -> Result<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".