async fn send_object(ob: &ObjectBuffer<'_>, socket: &mut TcpStream) -> std::io::Result<()> {
    // Write object header into the socket. The object header consists of a 16-bit value
    // describing the size of the metadata, and a 48-bit value describing the size of that
    // data. Thus, object metadata is limited to at most 64 KB, while object data can be
    // potentially as larger as 256 TB (though MAX_DATA_SIZE imposes 16 TB limit).
    // asserts are OK here because we check object sizes beforehand, and asserts should
    // never fail
    let meta_size = ob.meta().len() as u64;
    assert!(meta_size <= MAX_META_SIZE, "object metadata is too large");
    let data_size = ob.data().len() as u64;
    assert!(data_size <= MAX_DATA_SIZE, "object data is too large");
    let header = meta_size | (data_size << 16);
    socket.write_u64_le(header).await?;

    // write both data and metadata into the socket
    socket.write_all(ob.meta()).await?;
    socket.write_all(ob.data()).await?;

    Ok(())
}
/// Writes the object into the socket; the object is written as follows:
/// * first object header (data and meta size) is written as u64
/// * then, object metadata is written,
/// * and finally, object data buffer is written
Writes the object into the socket; the object is written as follows:
first object header (data and meta size) is written as u64
then, object metadata is written,
and finally, object data buffer is written
Writes the object into the socket ; the object is written as follows : first object header ( data and meta size ) is written as u64 then object metadata is written and finally object data buffer is written
async fn send_object(ob: &ObjectBuffer<'_>, socket: &mut TcpStream) -> std::io::Result<()> {
    // Write object header into the socket. The object header consists of a 16-bit value
    // describing the size of the metadata, and a 48-bit value describing the size of that
    // data. Thus, object metadata is limited to at most 64 KB, while object data can be
    // potentially as larger as 256 TB (though MAX_DATA_SIZE imposes 16 TB limit).
    // asserts are OK here because we check object sizes beforehand, and asserts should
    // never fail
    let meta_size = ob.meta().len() as u64;
    assert!(meta_size <= MAX_META_SIZE, "object metadata is too large");
    let data_size = ob.data().len() as u64;
    assert!(data_size <= MAX_DATA_SIZE, "object data is too large");
    let header = meta_size | (data_size << 16);
    socket.write_u64_le(header).await?;
    // write both data and metadata into the socket
    socket.write_all(ob.meta()).await?;
    socket.write_all(ob.data()).await?;
    Ok(())
}
async fn send_object ( ob : & ObjectBuffer < ' _ > , socket : & mut TcpStream ) -> std :: io :: Result < ( ) > { // Write object header into the socket. The object header consists of a 16-bit value // describing the size of the metadata, and a 48-bit value describing the size of that // data. Thus, object metadata is limited to at most 64 KB, while object data can be // potentially as larger as 256 TB (though MAX_DATA_SIZE imposes 16 TB limit). // asserts are OK here because we check object sizes beforehand, and asserts should // never fail let meta_size = ob . meta ( ) . len ( ) as u64 ; assert ! ( meta_size MAX_META_SIZE " " ) ; let data_size = ob . data ( ) . len ( ) as u64 ; assert ! ( data_size MAX_DATA_SIZE " " ) ; let header = meta_size | ( data_size << 16 ) ; socket . write_u64_le ( header ) . await ? ; // write both data and metadata into the socket socket . write_all ( ob . meta ( ) ) . await ? ; socket . write_all ( ob . data ( ) ) . await ? ; Ok ( ( ) ) }
Writes the object into the socket; the object is written as follows:
 first object header (data and meta size) is written as u64
 then, object metadata is written,
 and finally, object data buffer is written
Writes the object into the socket ; the object is written as follows : first object header ( data and meta size ) is written as u64 then object metadata is written and finally object data buffer is written
ob
&ObjectBuffer<'_>
socket
&mut TcpStream
ob
&ObjectBuffer<'_>
socket
&mut TcpStream