Trait webparse::binary::Buf

source ·
pub trait Buf {
Show 86 methods // Required methods fn remaining(&self) -> usize; fn chunk(&self) -> &[u8] ; fn advance(&mut self, n: usize); fn advance_chunk(&mut self, n: usize) -> &[u8] ; fn into_binary(self) -> Binary ; // Provided methods fn advance_all(&mut self) { ... } fn peek(&self) -> Option<u8> { ... } fn has_remaining(&self) -> bool { ... } fn get_next(&mut self) -> Option<u8> { ... } fn copy_to_slice(&mut self, dst: &mut [u8]) -> usize { ... } fn get_u8(&mut self) -> u8 { ... } fn try_get_u8(&mut self) -> Result<u8> { ... } fn get_i8(&mut self) -> i8 { ... } fn try_get_i8(&mut self) -> Result<i8> { ... } fn get_u16(&mut self) -> u16 { ... } fn try_get_u16(&mut self) -> Result<u16> { ... } fn get_u16_le(&mut self) -> u16 { ... } fn try_get_u16_le(&mut self) -> Result<u16> { ... } fn get_u16_ne(&mut self) -> u16 { ... } fn try_get_u16_ne(&mut self) -> Result<u16> { ... } fn get_i16(&mut self) -> i16 { ... } fn try_get_i16(&mut self) -> Result<i16> { ... } fn get_i16_le(&mut self) -> i16 { ... } fn try_get_i16_le(&mut self) -> Result<i16> { ... } fn get_i16_ne(&mut self) -> i16 { ... } fn try_get_i16_ne(&mut self) -> Result<i16> { ... } fn get_u32(&mut self) -> u32 { ... } fn try_get_u32(&mut self) -> Result<u32> { ... } fn get_u32_le(&mut self) -> u32 { ... } fn try_get_u32_le(&mut self) -> Result<u32> { ... } fn get_u32_ne(&mut self) -> u32 { ... } fn try_get_u32_ne(&mut self) -> Result<u32> { ... } fn get_i32(&mut self) -> i32 { ... } fn try_get_i32(&mut self) -> Result<i32> { ... } fn get_i32_le(&mut self) -> i32 { ... } fn try_get_i32_le(&mut self) -> Result<i32> { ... } fn get_i32_ne(&mut self) -> i32 { ... } fn try_get_i32_ne(&mut self) -> Result<i32> { ... } fn get_u64(&mut self) -> u64 { ... } fn try_get_u64(&mut self) -> Result<u64> { ... } fn get_u64_le(&mut self) -> u64 { ... } fn try_get_u64_le(&mut self) -> Result<u64> { ... } fn get_u64_ne(&mut self) -> u64 { ... } fn try_get_u64_ne(&mut self) -> Result<u64> { ... } fn get_i64(&mut self) -> i64 { ... } fn try_get_i64(&mut self) -> Result<i64> { ... } fn get_i64_le(&mut self) -> i64 { ... } fn try_get_i64_le(&mut self) -> Result<i64> { ... } fn get_i64_ne(&mut self) -> i64 { ... } fn try_get_i64_ne(&mut self) -> Result<i64> { ... } fn get_u128(&mut self) -> u128 { ... } fn try_get_u128(&mut self) -> Result<u128> { ... } fn get_u128_le(&mut self) -> u128 { ... } fn try_get_u128_le(&mut self) -> Result<u128> { ... } fn get_u128_ne(&mut self) -> u128 { ... } fn try_get_u128_ne(&mut self) -> Result<u128> { ... } fn get_i128(&mut self) -> i128 { ... } fn try_get_i128(&mut self) -> Result<i128> { ... } fn get_i128_le(&mut self) -> i128 { ... } fn try_get_i128_le(&mut self) -> Result<i128> { ... } fn get_i128_ne(&mut self) -> i128 { ... } fn try_get_i128_ne(&mut self) -> Result<i128> { ... } fn get_uint(&mut self, nbytes: usize) -> u64 { ... } fn try_get_uint(&mut self, nbytes: usize) -> Result<u64> { ... } fn get_uint_le(&mut self, nbytes: usize) -> u64 { ... } fn try_get_uint_le(&mut self, nbytes: usize) -> Result<u64> { ... } fn get_uint_ne(&mut self, nbytes: usize) -> u64 { ... } fn try_get_uint_ne(&mut self, nbytes: usize) -> Result<u64> { ... } fn get_int(&mut self, nbytes: usize) -> i64 { ... } fn try_get_int(&mut self, nbytes: usize) -> Result<i64> { ... } fn get_int_le(&mut self, nbytes: usize) -> i64 { ... } fn try_get_int_le(&mut self, nbytes: usize) -> Result<i64> { ... } fn get_int_ne(&mut self, nbytes: usize) -> i64 { ... } fn try_get_int_ne(&mut self, nbytes: usize) -> Result<i64> { ... } fn get_f32(&mut self) -> f32 { ... } fn try_get_f32(&mut self) -> Result<f32> { ... } fn get_f32_le(&mut self) -> f32 { ... } fn try_get_f32_le(&mut self) -> Result<f32> { ... } fn get_f32_ne(&mut self) -> f32 { ... } fn try_get_f32_ne(&mut self) -> Result<f32> { ... } fn get_f64(&mut self) -> f64 { ... } fn try_get_f64(&mut self) -> Result<f64> { ... } fn get_f64_le(&mut self) -> f64 { ... } fn try_get_f64_le(&mut self) -> Result<f64> { ... } fn get_f64_ne(&mut self) -> f64 { ... } fn try_get_f64_ne(&mut self) -> Result<f64> { ... }
}

Required Methods§

source

fn remaining(&self) -> usize

获取剩余数量

source

fn chunk(&self) -> &[u8]

获取当前数据的切片引用

source

fn advance(&mut self, n: usize)

消耗掉多少字节的数据, 做指针偏移

source

fn advance_chunk(&mut self, n: usize) -> &[u8]

消耗掉多少字节的数据并返回消耗的数据

source

fn into_binary(self) -> Binary

将数据转成Binary

Provided Methods§

source

fn advance_all(&mut self)

消耗所有的字节

source

fn peek(&self) -> Option<u8>

获取当前的值, 但不做任何偏移

source

fn has_remaining(&self) -> bool

是否还有数据

source

fn get_next(&mut self) -> Option<u8>

获取当前的值并将偏移值+1

source

fn copy_to_slice(&mut self, dst: &mut [u8]) -> usize

拷贝数据 self into dst.

§Examples
use webparse::binary;
use binary::Buf;

let mut buf = &b"hello world"[..];
let mut dst = [0; 5];

buf.copy_to_slice(&mut dst);
assert_eq!(&b"hello"[..], &dst);
assert_eq!(6, buf.remaining());
§Panics

This function panics if self.remaining() < dst.len()

source

fn get_u8(&mut self) -> u8

source

fn try_get_u8(&mut self) -> Result<u8>

source

fn get_i8(&mut self) -> i8

source

fn try_get_i8(&mut self) -> Result<i8>

source

fn get_u16(&mut self) -> u16

Gets an unsigned 16 bit integer from self in big-endian byte order.

The current position is advanced by 2.

§Examples
use webparse::Buf;

let mut buf = &b"\x08\x09 hello"[..];
assert_eq!(0x0809, buf.get_u16());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u16(&mut self) -> Result<u16>

source

fn get_u16_le(&mut self) -> u16

Gets an unsigned 16 bit integer from self in little-endian byte order.

The current position is advanced by 2.

§Examples
use webparse::Buf;

let mut buf = &b"\x09\x08 hello"[..];
assert_eq!(0x0809, buf.get_u16_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u16_le(&mut self) -> Result<u16>

source

fn get_u16_ne(&mut self) -> u16

Gets an unsigned 16 bit integer from self in native-endian byte order.

The current position is advanced by 2.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x08\x09 hello",
    false => b"\x09\x08 hello",
};
assert_eq!(0x0809, buf.get_u16_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u16_ne(&mut self) -> Result<u16>

source

fn get_i16(&mut self) -> i16

Gets a signed 16 bit integer from self in big-endian byte order.

The current position is advanced by 2.

§Examples
use webparse::Buf;

let mut buf = &b"\x08\x09 hello"[..];
assert_eq!(0x0809, buf.get_i16());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i16(&mut self) -> Result<i16>

source

fn get_i16_le(&mut self) -> i16

Gets a signed 16 bit integer from self in little-endian byte order.

The current position is advanced by 2.

§Examples
use webparse::Buf;

let mut buf = &b"\x09\x08 hello"[..];
assert_eq!(0x0809, buf.get_i16_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i16_le(&mut self) -> Result<i16>

source

fn get_i16_ne(&mut self) -> i16

Gets a signed 16 bit integer from self in native-endian byte order.

The current position is advanced by 2.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x08\x09 hello",
    false => b"\x09\x08 hello",
};
assert_eq!(0x0809, buf.get_i16_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i16_ne(&mut self) -> Result<i16>

source

fn get_u32(&mut self) -> u32

Gets an unsigned 32 bit integer from self in the big-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf = &b"\x08\x09\xA0\xA1 hello"[..];
assert_eq!(0x0809A0A1, buf.get_u32());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u32(&mut self) -> Result<u32>

source

fn get_u32_le(&mut self) -> u32

Gets an unsigned 32 bit integer from self in the little-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf = &b"\xA1\xA0\x09\x08 hello"[..];
assert_eq!(0x0809A0A1, buf.get_u32_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u32_le(&mut self) -> Result<u32>

source

fn get_u32_ne(&mut self) -> u32

Gets an unsigned 32 bit integer from self in native-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x08\x09\xA0\xA1 hello",
    false => b"\xA1\xA0\x09\x08 hello",
};
assert_eq!(0x0809A0A1, buf.get_u32_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u32_ne(&mut self) -> Result<u32>

source

fn get_i32(&mut self) -> i32

Gets a signed 32 bit integer from self in big-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf = &b"\x08\x09\xA0\xA1 hello"[..];
assert_eq!(0x0809A0A1, buf.get_i32());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i32(&mut self) -> Result<i32>

source

fn get_i32_le(&mut self) -> i32

Gets a signed 32 bit integer from self in little-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf = &b"\xA1\xA0\x09\x08 hello"[..];
assert_eq!(0x0809A0A1, buf.get_i32_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i32_le(&mut self) -> Result<i32>

source

fn get_i32_ne(&mut self) -> i32

Gets a signed 32 bit integer from self in native-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x08\x09\xA0\xA1 hello",
    false => b"\xA1\xA0\x09\x08 hello",
};
assert_eq!(0x0809A0A1, buf.get_i32_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i32_ne(&mut self) -> Result<i32>

source

fn get_u64(&mut self) -> u64

Gets an unsigned 64 bit integer from self in big-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf = &b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"[..];
assert_eq!(0x0102030405060708, buf.get_u64());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u64(&mut self) -> Result<u64>

source

fn get_u64_le(&mut self) -> u64

Gets an unsigned 64 bit integer from self in little-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf = &b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"[..];
assert_eq!(0x0102030405060708, buf.get_u64_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u64_le(&mut self) -> Result<u64>

source

fn get_u64_ne(&mut self) -> u64

Gets an unsigned 64 bit integer from self in native-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x01\x02\x03\x04\x05\x06\x07\x08 hello",
    false => b"\x08\x07\x06\x05\x04\x03\x02\x01 hello",
};
assert_eq!(0x0102030405060708, buf.get_u64_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u64_ne(&mut self) -> Result<u64>

source

fn get_i64(&mut self) -> i64

Gets a signed 64 bit integer from self in big-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf = &b"\x01\x02\x03\x04\x05\x06\x07\x08 hello"[..];
assert_eq!(0x0102030405060708, buf.get_i64());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i64(&mut self) -> Result<i64>

source

fn get_i64_le(&mut self) -> i64

Gets a signed 64 bit integer from self in little-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf = &b"\x08\x07\x06\x05\x04\x03\x02\x01 hello"[..];
assert_eq!(0x0102030405060708, buf.get_i64_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i64_le(&mut self) -> Result<i64>

source

fn get_i64_ne(&mut self) -> i64

Gets a signed 64 bit integer from self in native-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x01\x02\x03\x04\x05\x06\x07\x08 hello",
    false => b"\x08\x07\x06\x05\x04\x03\x02\x01 hello",
};
assert_eq!(0x0102030405060708, buf.get_i64_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i64_ne(&mut self) -> Result<i64>

source

fn get_u128(&mut self) -> u128

Gets an unsigned 128 bit integer from self in big-endian byte order.

The current position is advanced by 16.

§Examples
use webparse::Buf;

let mut buf = &b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello"[..];
assert_eq!(0x01020304050607080910111213141516, buf.get_u128());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u128(&mut self) -> Result<u128>

source

fn get_u128_le(&mut self) -> u128

Gets an unsigned 128 bit integer from self in little-endian byte order.

The current position is advanced by 16.

§Examples
use webparse::Buf;

let mut buf = &b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello"[..];
assert_eq!(0x01020304050607080910111213141516, buf.get_u128_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u128_le(&mut self) -> Result<u128>

source

fn get_u128_ne(&mut self) -> u128

Gets an unsigned 128 bit integer from self in native-endian byte order.

The current position is advanced by 16.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello",
    false => b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello",
};
assert_eq!(0x01020304050607080910111213141516, buf.get_u128_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_u128_ne(&mut self) -> Result<u128>

source

fn get_i128(&mut self) -> i128

Gets a signed 128 bit integer from self in big-endian byte order.

The current position is advanced by 16.

§Examples
use webparse::Buf;

let mut buf = &b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello"[..];
assert_eq!(0x01020304050607080910111213141516, buf.get_i128());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i128(&mut self) -> Result<i128>

source

fn get_i128_le(&mut self) -> i128

Gets a signed 128 bit integer from self in little-endian byte order.

The current position is advanced by 16.

§Examples
use webparse::Buf;

let mut buf = &b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello"[..];
assert_eq!(0x01020304050607080910111213141516, buf.get_i128_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i128_le(&mut self) -> Result<i128>

source

fn get_i128_ne(&mut self) -> i128

Gets a signed 128 bit integer from self in native-endian byte order.

The current position is advanced by 16.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x01\x02\x03\x04\x05\x06\x07\x08\x09\x10\x11\x12\x13\x14\x15\x16 hello",
    false => b"\x16\x15\x14\x13\x12\x11\x10\x09\x08\x07\x06\x05\x04\x03\x02\x01 hello",
};
assert_eq!(0x01020304050607080910111213141516, buf.get_i128_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_i128_ne(&mut self) -> Result<i128>

source

fn get_uint(&mut self, nbytes: usize) -> u64

Gets an unsigned n-byte integer from self in big-endian byte order.

The current position is advanced by nbytes.

§Examples
use webparse::Buf;

let mut buf = &b"\x01\x02\x03 hello"[..];
assert_eq!(0x010203, buf.get_uint(3));
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_uint(&mut self, nbytes: usize) -> Result<u64>

source

fn get_uint_le(&mut self, nbytes: usize) -> u64

Gets an unsigned n-byte integer from self in little-endian byte order.

The current position is advanced by nbytes.

§Examples
use webparse::Buf;

let mut buf = &b"\x03\x02\x01 hello"[..];
assert_eq!(0x010203, buf.get_uint_le(3));
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_uint_le(&mut self, nbytes: usize) -> Result<u64>

source

fn get_uint_ne(&mut self, nbytes: usize) -> u64

Gets an unsigned n-byte integer from self in native-endian byte order.

The current position is advanced by nbytes.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x01\x02\x03 hello",
    false => b"\x03\x02\x01 hello",
};
assert_eq!(0x010203, buf.get_uint_ne(3));
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_uint_ne(&mut self, nbytes: usize) -> Result<u64>

source

fn get_int(&mut self, nbytes: usize) -> i64

Gets a signed n-byte integer from self in big-endian byte order.

The current position is advanced by nbytes.

§Examples
use webparse::Buf;

let mut buf = &b"\x01\x02\x03 hello"[..];
assert_eq!(0x010203, buf.get_int(3));
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_int(&mut self, nbytes: usize) -> Result<i64>

source

fn get_int_le(&mut self, nbytes: usize) -> i64

Gets a signed n-byte integer from self in little-endian byte order.

The current position is advanced by nbytes.

§Examples
use webparse::Buf;

let mut buf = &b"\x03\x02\x01 hello"[..];
assert_eq!(0x010203, buf.get_int_le(3));
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_int_le(&mut self, nbytes: usize) -> Result<i64>

source

fn get_int_ne(&mut self, nbytes: usize) -> i64

Gets a signed n-byte integer from self in native-endian byte order.

The current position is advanced by nbytes.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x01\x02\x03 hello",
    false => b"\x03\x02\x01 hello",
};
assert_eq!(0x010203, buf.get_int_ne(3));
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_int_ne(&mut self, nbytes: usize) -> Result<i64>

source

fn get_f32(&mut self) -> f32

Gets an IEEE754 single-precision (4 bytes) floating point number from self in big-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf = &b"\x3F\x99\x99\x9A hello"[..];
assert_eq!(1.2f32, buf.get_f32());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_f32(&mut self) -> Result<f32>

source

fn get_f32_le(&mut self) -> f32

Gets an IEEE754 single-precision (4 bytes) floating point number from self in little-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf = &b"\x9A\x99\x99\x3F hello"[..];
assert_eq!(1.2f32, buf.get_f32_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_f32_le(&mut self) -> Result<f32>

source

fn get_f32_ne(&mut self) -> f32

Gets an IEEE754 single-precision (4 bytes) floating point number from self in native-endian byte order.

The current position is advanced by 4.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x3F\x99\x99\x9A hello",
    false => b"\x9A\x99\x99\x3F hello",
};
assert_eq!(1.2f32, buf.get_f32_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_f32_ne(&mut self) -> Result<f32>

source

fn get_f64(&mut self) -> f64

Gets an IEEE754 double-precision (8 bytes) floating point number from self in big-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf = &b"\x3F\xF3\x33\x33\x33\x33\x33\x33 hello"[..];
assert_eq!(1.2f64, buf.get_f64());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_f64(&mut self) -> Result<f64>

source

fn get_f64_le(&mut self) -> f64

Gets an IEEE754 double-precision (8 bytes) floating point number from self in little-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf = &b"\x33\x33\x33\x33\x33\x33\xF3\x3F hello"[..];
assert_eq!(1.2f64, buf.get_f64_le());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_f64_le(&mut self) -> Result<f64>

source

fn get_f64_ne(&mut self) -> f64

Gets an IEEE754 double-precision (8 bytes) floating point number from self in native-endian byte order.

The current position is advanced by 8.

§Examples
use webparse::Buf;

let mut buf: &[u8] = match cfg!(target_endian = "big") {
    true => b"\x3F\xF3\x33\x33\x33\x33\x33\x33 hello",
    false => b"\x33\x33\x33\x33\x33\x33\xF3\x3F hello",
};
assert_eq!(1.2f64, buf.get_f64_ne());
§Panics

This function panics if there is not enough remaining data in self.

source

fn try_get_f64_ne(&mut self) -> Result<f64>

Implementations on Foreign Types§

source§

impl Buf for &[u8]

source§

fn remaining(&self) -> usize

source§

fn chunk(&self) -> &[u8]

source§

fn advance_chunk(&mut self, n: usize) -> &[u8]

source§

fn advance(&mut self, cnt: usize)

source§

fn into_binary(self) -> Binary

source§

impl<T: AsRef<[u8]>> Buf for Cursor<T>

source§

fn remaining(&self) -> usize

source§

fn chunk(&self) -> &[u8]

source§

fn advance_chunk(&mut self, n: usize) -> &[u8]

source§

fn advance(&mut self, cnt: usize)

source§

fn into_binary(self) -> Binary

Implementors§

source§

impl Buf for Binary

source§

impl Buf for BinaryMut

source§

impl<'a> Buf for BinaryRef<'a>