#[repr(C)]
pub struct clingo_script { pub execute: Option<unsafe extern "C" fn(location: *const clingo_location_t, code: *const c_char, data: *mut c_void) -> bool>, pub call: Option<unsafe extern "C" fn(location: *const clingo_location_t, name: *const c_char, arguments: *const clingo_symbol_t, arguments_size: usize, symbol_callback: clingo_symbol_callback_t, symbol_callback_data: *mut c_void, data: *mut c_void) -> bool>, pub callable: Option<unsafe extern "C" fn(name: *const c_char, result: *mut bool, data: *mut c_void) -> bool>, pub main: Option<unsafe extern "C" fn(control: *mut clingo_control_t, data: *mut c_void) -> bool>, pub free: Option<unsafe extern "C" fn(data: *mut c_void)>, pub version: *const c_char, }
Expand description

! Custom scripting language to run functions during grounding.

Fields§

§execute: Option<unsafe extern "C" fn(location: *const clingo_location_t, code: *const c_char, data: *mut c_void) -> bool>

! Evaluate the given source code. ! @param[in] location the location in the logic program of the source code ! @param[in] code the code to evaluate ! @param[in] data user data as given when registering the script ! @return whether the function call was successful

§call: Option<unsafe extern "C" fn(location: *const clingo_location_t, name: *const c_char, arguments: *const clingo_symbol_t, arguments_size: usize, symbol_callback: clingo_symbol_callback_t, symbol_callback_data: *mut c_void, data: *mut c_void) -> bool>

! Call the function with the given name and arguments. ! @param[in] location the location in the logic program of the function call ! @param[in] name the name of the function ! @param[in] arguments the arguments to the function ! @param[in] arguments_size the number of arguments ! @param[in] symbol_callback callback to return a pool of symbols ! @param[in] symbol_callback_data user data for the symbol callback ! @param[in] data user data as given when registering the script ! @return whether the function call was successful

§callable: Option<unsafe extern "C" fn(name: *const c_char, result: *mut bool, data: *mut c_void) -> bool>

! Check if the given function is callable. ! @param[in] name the name of the function ! @param[out] result whether the function is callable ! @param[in] data user data as given when registering the script ! @return whether the function call was successful

§main: Option<unsafe extern "C" fn(control: *mut clingo_control_t, data: *mut c_void) -> bool>

! Run the main function. ! @param[in] control the control object to pass to the main function ! @param[in] data user data as given when registering the script ! @return whether the function call was successful

§free: Option<unsafe extern "C" fn(data: *mut c_void)>

! This function is called once when the script is deleted. ! @param[in] data user data as given when registering the script

§version: *const c_char

Trait Implementations§

source§

impl Clone for clingo_script

source§

fn clone(&self) -> clingo_script

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for clingo_script

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for clingo_script

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.