fn read_from<R: io::Read>(buf: &mut R) -> Result<VarLong, Error> {
        const PART : u64 = 0x7F;
        let mut size = 0;
        let mut val = 0u64;
        loop {
            let b = buf.read_u8()? as u64;
            val |= (b & PART) << (size * 7);
            size += 1;
            if size > 10 {
                return Result::Err(Error::Err("VarLong too big".to_owned()));
            }
            if (b & 0x80) == 0 {
                break
            }
        }

        Result::Ok(VarLong(val as i64))
    }
/// Decodes a `VarLong` from the Reader
Decodes a `VarLong` from the Reader
Decodes a ` VarLong ` from the Reader
fn read_from<R: io::Read>(buf: &mut R) -> Result<VarLong, Error> {
        const PART : u64 = 0x7F;
        let mut size = 0;
        let mut val = 0u64;
        loop {
            let b = buf.read_u8()? as u64;
            val |= (b & PART) << (size * 7);
            size += 1;
            if size > 10 {
                return Result::Err(Error::Err("VarLong too big".to_owned()));
            }
            if (b & 0x80) == 0 {
                break
            }
        }
        Result::Ok(VarLong(val as i64))
    }
fn read_from < R : io :: Read > ( buf : & mut R ) -> Result < VarLong , Error > { const PART : u64 = 0x7F ; let mut size = 0 ; let mut val = 0u64 ; loop { let b = buf . read_u8 ( ) ? as u64 ; val |= ( b & PART ) << ( size * 7 ) ; size += 1 ; if size > 10 { return Result :: Err ( Error :: Err ( " " . to_owned ( ) ) ) ; } if ( b & 0x80 ) == 0 { break } } Result :: Ok ( VarLong ( val as i64 ) ) }
Decodes a `VarLong` from the Reader
Decodes a ` VarLong ` from the Reader
buf
&mut R