[][src]Struct exonum::messages::MessageBuffer

pub struct MessageBuffer { /* fields omitted */ }

A raw message represented by the bytes buffer.

Methods

impl MessageBuffer
[src]

Creates MessageBuffer instance from the bytes vector.

Example

use exonum::messages::MessageBuffer;

let message_buffer = MessageBuffer::from_vec(vec![1, 2, 3]);
assert!(!message_buffer.is_empty());

Returns the length of the message in bytes.

Example

use exonum::messages::MessageBuffer;

let data = vec![1, 2, 3];
let message_buffer = MessageBuffer::from_vec(data.clone());
assert_eq!(data.len(), message_buffer.len());

Returns true if the MessageBuffer contains no bytes.

Example

use exonum::messages::MessageBuffer;

let message_buffer = MessageBuffer::from_vec(vec![]);
assert!(message_buffer.is_empty());

Returns the protocol version.

Returns id of the service.

Returns type of the message.

Returns message body without signature.

Returns signature of the message.

Checks that Field can be safely got with specified from and to offsets.

Returns Field specified by from and to offsets. Should not be used directly.

Trait Implementations

impl PartialEq<MessageBuffer> for MessageBuffer
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl AsRef<[u8]> for MessageBuffer
[src]

Performs the conversion.

impl Debug for MessageBuffer
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

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

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

Immutably borrows from an owned value. Read more

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

Mutably borrows from an owned value. Read more

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

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

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

Writes the hex string representing self into w. Lower case letters are used (e.g. f9b4ca). Read more

Writes the hex string representing self into w. Upper case letters are used (e.g. F9B4CA). Read more

impl<T> Same for T

Should always be Self