pub fn stop_all_workers(conn: &PgConnection) -> Result<usize, MeshSimError> {
    use schema::worker_velocities::dsl::*;

    let rows = diesel::update(worker_velocities)
        .set((x.eq(0.0), y.eq(0.0)))
        .execute(conn)
        .map_err(|e| {
            let error_msg = String::from("Failed to stop workers");
            MeshSimError {
                kind: MeshSimErrorKind::SQLExecutionFailure(error_msg),
                cause: Some(Box::new(e)),
            }
        })?;

    Ok(rows)
}
/// Set the velocity of all workers to 0
Set the velocity of all workers to 0
Set the velocity of all workers to 0
pub fn stop_all_workers(conn: &PgConnection) -> Result<usize, MeshSimError> {
    use schema::worker_velocities::dsl::*;
    let rows = diesel::update(worker_velocities)
        .set((x.eq(0.0), y.eq(0.0)))
        .execute(conn)
        .map_err(|e| {
            let error_msg = String::from("Failed to stop workers");
            MeshSimError {
                kind: MeshSimErrorKind::SQLExecutionFailure(error_msg),
                cause: Some(Box::new(e)),
            }
        })?;
    Ok(rows)
}
pub fn stop_all_workers ( conn : & PgConnection ) -> Result < usize , MeshSimError > { use schema :: worker_velocities :: dsl :: * ; let rows = diesel :: update ( worker_velocities ) . set ( ( x . eq ( 0.0 ) , y . eq ( 0.0 ) ) ) . execute ( conn ) . map_err ( | e | { let error_msg = String :: from ( " " ) ; MeshSimError { kind : MeshSimErrorKind :: SQLExecutionFailure ( error_msg ) , cause : Some ( Box :: new ( e ) ) , } } ) ? ; Ok ( rows ) }
Set the velocity of all workers to 0
Set the velocity of all workers to 0
conn
&PgConnection