pub struct Message {
/// The underlying raw data of the message.
bytes: Bytes,
}
Expand description
Normalized (hashed) message authenticated by a signature.
Fields
bytes: Bytes
The underlying raw data of the message.
Implementations
pub fn new() -> Self
pub fn new() -> Self
Creates a new instance of a Message.
Returns
[Message] - A new, empty Message.
Examples
use std::crypto::Message;
fn foo() {
let new_message = Message::new();
assert(new_message.bytes().len() == 0);
}
pub fn bytes(self) -> Bytes
pub fn bytes(self) -> Bytes
Returns the underlying raw Bytes
data of the signature.
Returns
- [Bytes] - The raw data of the signature.
Examples
use std::crypto::Message;
fn foo() -> {
let new_message = Message::new();
assert(new_message.bytes().len() == 0);
}
Trait Implementations
impl AbiEncode for Message
impl AbiEncode for Message
pub fn abi_encode(self, buffer: Buffer) -> Buffer
impl AbiDecode for Message
impl AbiDecode for Message
pub fn abi_decode(refmut buffer: BufferReader) -> Self
impl Eq for Message
impl Eq for Message
pub fn eq(self, other: Self) -> bool
pub fn neq(self, other: Self) -> bool
pub fn neq(self, other: Self) -> bool
Evaluates if two values of the same type are not equal.
Additional Information
This function is inherited when eq()
is implemented.
Arguments
other
: [Self] - The value of the same type.
Returns
- [bool] -
true
if the two values are not equal, otherwisefalse
.
Examples
struct MyStruct {
val: u64,
}
impl Eq for MyStruct {
fn eq(self, other: Self) -> bool {
self.val == other.val
}
}
fn foo() {
let struct1 = MyStruct { val: 10 };
let struct2 = MyStruct { val: 2 };
let result = struct1 != struct2;
assert(result);
}