pub struct JsProgram { /* private fields */ }Expand description
Functional program for computing semantics
Implementations§
Source§impl JsProgram
impl JsProgram
pub fn into_reference(val: JsProgram, env: Env) -> Result<Reference<JsProgram>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<JsProgram>>
Source§impl JsProgram
impl JsProgram
Sourcepub fn constant(value: &JsSemanticValue) -> Self
pub fn constant(value: &JsSemanticValue) -> Self
Create a constant program
Sourcepub fn primitive(prim: &JsPrimitive, args: Vec<&JsProgram>) -> Self
pub fn primitive(prim: &JsPrimitive, args: Vec<&JsProgram>) -> Self
Create a primitive operation program
Sourcepub fn if_then_else(
cond: &JsProgram,
then_branch: &JsProgram,
else_branch: &JsProgram,
) -> Self
pub fn if_then_else( cond: &JsProgram, then_branch: &JsProgram, else_branch: &JsProgram, ) -> Self
Create a conditional program
Sourcepub fn is_constant(&self) -> bool
pub fn is_constant(&self) -> bool
Check if this is a constant program
Trait Implementations§
Source§impl FromNapiMutRef for JsProgram
impl FromNapiMutRef for JsProgram
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for JsProgram
impl FromNapiRef for JsProgram
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &JsProgram
impl FromNapiValue for &JsProgram
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut JsProgram
impl FromNapiValue for &mut JsProgram
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for JsProgram
impl ToNapiValue for JsProgram
Source§unsafe fn to_napi_value(env: napi_env, val: JsProgram) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: JsProgram) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &JsProgram
impl ValidateNapiValue for &JsProgram
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut JsProgram
impl ValidateNapiValue for &mut JsProgram
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for JsProgram
impl RefUnwindSafe for JsProgram
impl Send for JsProgram
impl Sync for JsProgram
impl Unpin for JsProgram
impl UnsafeUnpin for JsProgram
impl UnwindSafe for JsProgram
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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