Updated readme. Added bundle support. (#61)

Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
This commit is contained in:
Anand Krishnamoorthi
2023-12-06 15:47:50 -08:00
committed by GitHub
parent 70bf371ebf
commit 8a73b4bef9
12 changed files with 280 additions and 31 deletions

View File

@@ -9,6 +9,9 @@ use crate::scheduler::*;
use crate::utils::gather_functions;
use crate::value::*;
use std::convert::AsRef;
use std::path::Path;
use anyhow::Result;
#[derive(Clone)]
@@ -42,7 +45,7 @@ impl Engine {
Ok(())
}
pub fn add_policy_from_file(&mut self, path: String) -> Result<()> {
pub fn add_policy_from_file<P: AsRef<Path>>(&mut self, path: P) -> Result<()> {
let source = Source::from_file(path)?;
let mut parser = Parser::new(&source)?;
self.modules.push(Ref::new(parser.parse()?));