[][src]Struct koibumi_core::message::Object

pub struct Object { /* fields omitted */ }

An "object" message that consists of a object such as a public key or an one-to-one message.

Implementations

impl Object[src]

pub const MAX_OBJECT_PAYLOAD_LENGTH: usize[src]

The maximum length of the payload of a object message.

pub fn new(
    nonce: Nonce,
    header: Header,
    object_payload: Vec<u8>
) -> Result<Self, TooLongError>
[src]

Constructs an object message from the specified parameters.

pub fn nonce(&self) -> Nonce[src]

Returns the nonce of the proof of work.

pub fn header(&self) -> &Header[src]

Returns the object header.

pub fn object_payload(&self) -> &[u8][src]

Returns the payload of the object message.

pub fn inv_hash(&self) -> InvHash[src]

Returns the inventory hash of the object message.

pub fn validate_pow_custom(
    &self,
    config: &Config,
    nonce_trials_per_byte: NonceTrialsPerByte,
    extra_bytes: PayloadLengthExtraBytes,
    now: Time
) -> Result<(), ValidateError>
[src]

Validates the proof of work of the object message with the specified custom parameters.

pub fn validate_pow(&self, config: &Config) -> Result<(), ValidateError>[src]

Validates the proof of work of the object message with the default parameters.

Trait Implementations

impl Clone for Object[src]

impl Debug for Object[src]

impl Eq for Object[src]

impl Hash for Object[src]

impl Message for Object[src]

impl PartialEq<Object> for Object[src]

impl SizedReadFrom for Object[src]

impl StructuralEq for Object[src]

impl StructuralPartialEq for Object[src]

impl TryFrom<Object> for Msg[src]

type Error = TryIntoMsgError

The type returned in the event of a conversion error.

impl TryFrom<Object> for Broadcast[src]

type Error = TryIntoBroadcastError

The type returned in the event of a conversion error.

impl WriteTo for Object[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pack for T where
    T: WriteTo + Message
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SizedReadFromExact for T where
    T: SizedReadFrom
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.