Struct itron_solid_asp3::messagebuffer::MessageBuffer[][src]

pub struct MessageBuffer(_);
This is supported on crate feature unstable and (crate features asp3 and messagebuf, or crate features solid_asp3 and messagebuf, or crate feature none) and crate feature dcre and non-crate feature asp3 only.
Expand description

An owned message buffer.

Deletes the message buffer automatically when dropped. The destructor will panic if the deletion fails.

Implementations

acre_mbf: Create a builder for MessageBuffer.

Examples
use itron::messagebuffer::MessageBuffer;
let buffer = MessageBuffer::build()
    .capacity(128)
    .max_message_size(64)
    .finish()
    .expect("failed to create a message buffer");

buffer.as_ref().send(&[0u8; 32])
   .expect("failed to send a message");

let mut got_message = [0u8; 64];
let got_message_len = unsafe {
    buffer
        .as_ref()
        .recv(&mut got_message)
        .expect("failed to receive a message")
};
assert_eq!(got_message_len, 32);

Construct a MessageBuffer from a raw object ID.

Safety

See Object ID Wrappers.

Consume and “leak” self, returning a reference MessageBufferRef<'a>.

Get the raw object ID.

Get the raw object ID as abi::NonNullID.

Borrow MessageBuffer as MessageBufferRef.

Use this to perform operations on message buffers because most of the methods are implemented on MessageBufferRef but not MessageBuffer.

Trait Implementations

Formats the value using the given formatter. Read more

Executes the destructor for this type. Read more

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

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.