cardamon 0.0.9

Cardamon is a tool to help development teams measure the power consumption and carbon emissions of their software.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::entities::run;
use anyhow::{self, Context};
use sea_orm::*;

pub async fn fetch(id: i32, db: &DatabaseConnection) -> anyhow::Result<run::Model> {
    run::Entity::find()
        .filter(run::Column::Id.eq(id))
        .one(db)
        .await?
        .context(format!("Error fetching run with id {}", id))
}