StdLib

Struct StdLib 

Source
pub struct StdLib;
Expand description

Standard library function implementations

Implementations§

Source§

impl StdLib

Source

pub fn dispatch( &self, func_name: &str, args: &[JsonnetValue], ) -> Result<JsonnetValue>

Dispatches a standard library function call.

Source

pub fn ai_http_get(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

ai.httpGet(url, headers?) - HTTP GET request

Source

pub fn ai_http_post(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

ai.httpPost(url, body, headers?) - HTTP POST request

Source

pub fn ai_call_model(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

ai.callModel(model, prompt, options?) - Call AI model

Source

pub fn tool_execute(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

tool.execute(name, args) - Execute external tool

Source

pub fn memory_get(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

memory.get(key) - Get value from memory

Source

pub fn memory_set(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

memory.set(key, value) - Set value in memory

Source

pub fn agent_create(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

agent.create(config) - Create AI agent

Source

pub fn std_ext_var(&self, args: Vec<JsonnetValue>) -> Result<JsonnetValue>

std.extVar(name) - Get external variable

Source

pub fn std_manifest_json(&self, args: Vec<JsonnetValue>) -> Result<JsonnetValue>

std.manifestJson(value, indent?) - JSON manifest with optional indentation

Source

pub fn length(args: Vec<JsonnetValue>) -> Result<JsonnetValue>

std.length(x) - returns length of array, string, or object

Source

pub fn call_function( name: &str, args: Vec<JsonnetValue>, ) -> Result<JsonnetValue>

Call a standard library function (static method)

Auto Trait Implementations§

§

impl Freeze for StdLib

§

impl RefUnwindSafe for StdLib

§

impl Send for StdLib

§

impl Sync for StdLib

§

impl Unpin for StdLib

§

impl UnwindSafe for StdLib

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.