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);
Consume and “leak” self
, returning a reference MessageBufferRef<'a>
.
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
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.