git.delta.rocks / jrsonnet / refs/commits / ad7852dc047c

difftreelog

source

crates/nix-eval/src/lib.rs777 Bsourcehistory
1//! This whole library should be replaced with either binding to nix libexpr,2//! or with tvix (once it is able to build NixOS).3//!4//! Current api is awful, little effort was put into this implementation.56use std::sync::Arc;78pub use pool::NixSessionPool;9use pool::NixSessionPoolInner;10use r2d2::PooledConnection;11pub use session::{Error, Result};12pub use value::{Index, Value};1314mod pool;15mod session;16mod value;17// Contains macros helpers18#[doc(hidden)]19pub mod macros;2021#[derive(Clone)]22pub struct NixSession(pub(crate) Arc<tokio::sync::Mutex<PooledConnection<NixSessionPoolInner>>>);2324impl NixSession {25	fn ptr_eq(a: &Self, b: &Self) -> bool {26		Arc::ptr_eq(&a.0, &b.0)27	}28}2930pub fn init_tokio() {31	let _ = pool::TOKIO_RUNTIME.set(tokio::runtime::Handle::current());32}