pub struct Options { /* private fields */ }Expand description
Parser/runtime extension registry.
Implementations§
Source§impl Options
impl Options
pub fn new() -> Options
Sourcepub fn convert_legacy(&mut self, enabled: bool) -> &mut Options
pub fn convert_legacy(&mut self, enabled: bool) -> &mut Options
Enable or disable transparent conversion of legacy function objects (on by default). When disabled, a bare JSON object is rejected as a parse error rather than being treated as a legacy function.
Sourcepub fn macro_def(
&mut self,
name: impl Into<String>,
params: Vec<String>,
body: Value,
) -> &mut Options
pub fn macro_def( &mut self, name: impl Into<String>, params: Vec<String>, body: Value, ) -> &mut Options
Register a macro expanded at parse time.
Sourcepub fn function(
&mut self,
name: impl Into<String>,
params: Vec<String>,
body: Value,
) -> &mut Options
pub fn function( &mut self, name: impl Into<String>, params: Vec<String>, body: Value, ) -> &mut Options
Register a function invoked at evaluation time (may recurse).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Options
impl !RefUnwindSafe for Options
impl !UnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more