Add BoolNum type and test on slow GLS
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::eventchunker::EventFull;
|
||||
use err::Error;
|
||||
use futures_core::Stream;
|
||||
use futures_util::StreamExt;
|
||||
use netpod::NanoRange;
|
||||
use netpod::{BoolNum, NanoRange};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::marker::PhantomData;
|
||||
use std::mem::size_of;
|
||||
@@ -39,6 +39,18 @@ pub trait NumFromBytes<NTY, END> {
|
||||
fn convert(buf: &[u8], big_endian: bool) -> NTY;
|
||||
}
|
||||
|
||||
impl NumFromBytes<BoolNum, LittleEndian> for BoolNum {
|
||||
fn convert(buf: &[u8], _big_endian: bool) -> BoolNum {
|
||||
BoolNum(buf[0])
|
||||
}
|
||||
}
|
||||
|
||||
impl NumFromBytes<BoolNum, BigEndian> for BoolNum {
|
||||
fn convert(buf: &[u8], _big_endian: bool) -> BoolNum {
|
||||
BoolNum(buf[0])
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! impl_num_from_bytes_end {
|
||||
($nty:ident, $nl:expr, $end:ident, $ec:ident) => {
|
||||
impl NumFromBytes<$nty, $end> for $nty {
|
||||
|
||||
Reference in New Issue
Block a user