[−][src]Struct zmq::Message
Holds a 0MQ message.
A message is a single frame, either received or created locally and then
sent over the wire. Multipart messages are transmitted as multiple
Message
s.
In rust-zmq, you aren't required to create message objects if you use the
convenience APIs provided (e.g. Socket::recv_bytes()
or
Socket::send_str()
). However, using message objects can make multiple
operations in a loop more efficient, since allocated memory can be reused.
Methods
impl Message
[src]
impl Message
pub fn new() -> Result<Message>
[src]
pub fn new() -> Result<Message>
Create an empty Message
.
pub unsafe fn with_capacity_unallocated(len: usize) -> Result<Message>
[src]
pub unsafe fn with_capacity_unallocated(len: usize) -> Result<Message>
Create a Message
preallocated with len
uninitialized bytes.
pub fn with_capacity(len: usize) -> Result<Message>
[src]
pub fn with_capacity(len: usize) -> Result<Message>
Create a Message
with space for len
bytes that are initialized to 0.
pub fn from_slice(data: &[u8]) -> Result<Message>
[src]
pub fn from_slice(data: &[u8]) -> Result<Message>
Create a Message
from a &[u8]
. This will copy data
into the message.
pub fn as_str(&self) -> Option<&str>
[src]
pub fn as_str(&self) -> Option<&str>
Return the message content as a string slice if it is valid UTF-8.
pub fn get_more(&self) -> bool
[src]
pub fn get_more(&self) -> bool
Return the ZMQ_MORE
flag, which indicates if more parts of a multipart
message will follow.
pub fn gets<'a>(&'a mut self, property: &str) -> Option<&'a str>
[src]
pub fn gets<'a>(&'a mut self, property: &str) -> Option<&'a str>
Query a message metadata property.
Trait Implementations
impl Drop for Message
[src]
impl Drop for Message
impl Eq for Message
[src]
impl Eq for Message
impl PartialEq<Message> for Message
[src]
impl PartialEq<Message> for Message
fn eq(&self, other: &Message) -> bool
[src]
fn eq(&self, other: &Message) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl Debug for Message
[src]
impl Debug for Message
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Deref for Message
[src]
impl Deref for Message
type Target = [u8]
The resulting type after dereferencing.
fn deref(&self) -> &[u8]
[src]
fn deref(&self) -> &[u8]
Dereferences the value.
impl DerefMut for Message
[src]
impl DerefMut for Message
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 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> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,