pub trait TrimBytes {
    // Required method
    fn trim(&self) -> &Self;
}
Expand description

Trait to trim a byte slice &[u8] similarly to str::trim().

Required Methods§

source

fn trim(&self) -> &Self

Returns a byte slice with leading and trailing whitespace removed.

Example
use t2plugin::slread::{SliceReader, TrimBytes};
use t2plugin::packet::Packet;

let slr = SliceReader::new(packet.l7_header());
// read the first line of the packet payload and trim it
let line = try!(slr.read_line()).trim();

Implementations on Foreign Types§

source§

impl TrimBytes for [u8]

source§

fn trim(&self) -> &Self

Implementors§