fn future_write_to_io(
    particles: &[ParticleDto],
    buffer: &mut impl std::io::Write,
) -> std::io::Result<()> {
    let length = particles.len();

    buffer.write(&(length as u64).to_le_bytes())?;
    for particle in particles {
        buffer.write(&to_le_bytes(&particle.position))?;
        buffer.write(&to_le_bytes(&particle.velocity))?;
        buffer.write(&particle.density.to_le_bytes())?;
        buffer.write(&particle.pressure.to_le_bytes())?;
    }
    buffer.flush()?;

    Ok(())
}
// This is in preparation for trying to reimplement
// particle using geometric vector types from nalgebra
This is in preparation for trying to reimplement
particle using geometric vector types from nalgebra
This is in preparation for trying to reimplement particle using geometric vector types from nalgebra
fn future_write_to_io(
    particles: &[ParticleDto],
    buffer: &mut impl std::io::Write,
) -> std::io::Result<()> {
    let length = particles.len();
    buffer.write(&(length as u64).to_le_bytes())?;
    for particle in particles {
        buffer.write(&to_le_bytes(&particle.position))?;
        buffer.write(&to_le_bytes(&particle.velocity))?;
        buffer.write(&particle.density.to_le_bytes())?;
        buffer.write(&particle.pressure.to_le_bytes())?;
    }
    buffer.flush()?;
    Ok(())
}
fn future_write_to_io ( particles : & [ ParticleDto ] , buffer : & mut impl std :: io :: Write , ) -> std :: io :: Result < ( ) > { let length = particles . len ( ) ; buffer . write ( & ( length as u64 ) . to_le_bytes ( ) ) ? ; for particle in particles { buffer . write ( & to_le_bytes ( & particle . position ) ) ? ; buffer . write ( & to_le_bytes ( & particle . velocity ) ) ? ; buffer . write ( & particle . density . to_le_bytes ( ) ) ? ; buffer . write ( & particle . pressure . to_le_bytes ( ) ) ? ; } buffer . flush ( ) ? ; Ok ( ( ) ) }
This is in preparation for trying to reimplement
particle using geometric vector types from nalgebra
This is in preparation for trying to reimplement particle using geometric vector types from nalgebra
particles
&[ParticleDto]
buffer
&mut impl std::io::Write
particles
&[ParticleDto]
buffer
&mut impl std::io::Write