pub struct Object { /* private fields */ }
Expand description
An “object” message that consists of a object such as a public key or an one-to-one message.
Implementations§
Source§impl Object
impl Object
Sourcepub const MAX_OBJECT_PAYLOAD_LENGTH: usize = 262_144usize
pub const MAX_OBJECT_PAYLOAD_LENGTH: usize = 262_144usize
The maximum length of the payload of a object message.
Sourcepub fn new(
nonce: Nonce,
header: Header,
object_payload: Vec<u8>,
) -> Result<Self, TooLongError>
pub fn new( nonce: Nonce, header: Header, object_payload: Vec<u8>, ) -> Result<Self, TooLongError>
Constructs an object message from the specified parameters.
Sourcepub fn object_payload(&self) -> &[u8] ⓘ
pub fn object_payload(&self) -> &[u8] ⓘ
Returns the payload of the object message.
Sourcepub fn validate_pow_custom(
&self,
config: &Config,
nonce_trials_per_byte: NonceTrialsPerByte,
extra_bytes: PayloadLengthExtraBytes,
now: Time,
) -> Result<(), ValidateError>
pub fn validate_pow_custom( &self, config: &Config, nonce_trials_per_byte: NonceTrialsPerByte, extra_bytes: PayloadLengthExtraBytes, now: Time, ) -> Result<(), ValidateError>
Validates the proof of work of the object message with the specified custom parameters.
Sourcepub fn validate_pow(&self, config: &Config) -> Result<(), ValidateError>
pub fn validate_pow(&self, config: &Config) -> Result<(), ValidateError>
Validates the proof of work of the object message with the default parameters.
Trait Implementations§
Source§impl SizedReadFrom for Object
impl SizedReadFrom for Object
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
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