async fn read_object_id_list(socket: &mut TcpStream) -> Result<Vec<ObjectId>, std::io::Error> {
    // determine number of object IDs
    let num_ids = socket.read_u16_le().await? as usize;

    // read all object ID bytes
    let mut result = vec![0u8; OBJECT_ID_BYTES * num_ids];
    socket.read_exact(&mut result).await?;

    // convert the vector of bytes into a vector of 20-byte arrays
    let mut v = std::mem::ManuallyDrop::new(result);
    let p = v.as_mut_ptr();
    let len = v.len() / OBJECT_ID_BYTES;
    let cap = v.capacity() / OBJECT_ID_BYTES;
    unsafe { Ok(Vec::from_raw_parts(p as *mut ObjectId, len, cap)) }
}
/// Reads a list of object IDs from the specified socket.
Reads a list of object IDs from the specified socket.
Reads a list of object IDs from the specified socket .
async fn read_object_id_list(socket: &mut TcpStream) -> Result<Vec<ObjectId>, std::io::Error> {
    // determine number of object IDs
    let num_ids = socket.read_u16_le().await? as usize;
    // read all object ID bytes
    let mut result = vec![0u8; OBJECT_ID_BYTES * num_ids];
    socket.read_exact(&mut result).await?;
    // convert the vector of bytes into a vector of 20-byte arrays
    let mut v = std::mem::ManuallyDrop::new(result);
    let p = v.as_mut_ptr();
    let len = v.len() / OBJECT_ID_BYTES;
    let cap = v.capacity() / OBJECT_ID_BYTES;
    unsafe { Ok(Vec::from_raw_parts(p as *mut ObjectId, len, cap)) }
}
async fn read_object_id_list ( socket : & mut TcpStream ) -> Result < Vec < ObjectId > , std :: io :: Error > { // determine number of object IDs let num_ids = socket . read_u16_le ( ) . await ? as usize ; // read all object ID bytes let mut result = vec ! [ 0u8 OBJECT_ID_BYTES num_ids ] ; socket . read_exact ( & mut result ) . await ? ; // convert the vector of bytes into a vector of 20-byte arrays let mut v = std :: mem :: ManuallyDrop :: new ( result ) ; let p = v . as_mut_ptr ( ) ; let len = v . len ( ) / OBJECT_ID_BYTES ; let cap = v . capacity ( ) / OBJECT_ID_BYTES ; unsafe { Ok ( Vec :: from_raw_parts ( p as * mut ObjectId , len , cap ) ) } }
Reads a list of object IDs from the specified socket.
Reads a list of object IDs from the specified socket .
socket
&mut TcpStream
socket
&mut TcpStream