[][src]Struct nng::Header

pub struct Header { /* fields omitted */ }

The header of a Message.

Most normal applications will never have to touch the message header. The only time it will be necessary is if the socket is in "raw" mode.

Methods

impl Header[src]

pub fn truncate(&mut self, len: usize)[src]

Shortens the message header, keeping the first len bytes.

If len is greater than the message header's current length, this has no effect.

pub fn trim(&mut self, len: usize)[src]

Remove the first len bytes from the front of the message header.

If len is greater than the message header's current length then this will clear the entire message.

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

Returns a slice that contains the contents of the message header.

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

Returns a mutable slice that contains the contents of the message header.

pub fn len(&self) -> usize[src]

Returns the length of the message header.

pub fn is_empty(&self) -> bool[src]

Returns true if the message header is empty.

pub fn clear(&mut self)[src]

Clears the message header.

pub fn push_back(&mut self, data: &[u8]) -> Result<()>[src]

Appends the data to the back of the message header.

pub fn push_front(&mut self, data: &[u8]) -> Result<()>[src]

Prepends the data to the message header.

Trait Implementations

impl Send for Header[src]

impl Sync for Header[src]

impl Extend<u8> for Header[src]

impl<'a> Extend<&'a u8> for Header[src]

impl Deref for Header[src]

type Target = [u8]

The resulting type after dereferencing.

impl DerefMut for Header[src]

impl Debug for Header[src]

impl<I: SliceIndex<[u8]>> Index<I> for Header[src]

type Output = I::Output

The returned type after indexing.

impl<I: SliceIndex<[u8]>> IndexMut<I> for Header[src]

impl Write for Header[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

type Error = !

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.

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

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

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