[−][src]Struct nng::Header
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]
fn extend<I: IntoIterator<Item = u8>>(&mut self, iter: I)
[src]
impl<'a> Extend<&'a u8> for Header
[src]
fn extend<I: IntoIterator<Item = &'a u8>>(&mut self, iter: I)
[src]
impl Deref for Header
[src]
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.
fn index(&self, index: I) -> &Self::Output
[src]
impl<I: SliceIndex<[u8]>> IndexMut<I> for Header
[src]
impl Write for Header
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn write_all(&mut self, buf: &[u8]) -> Result<()>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,