pub struct PrimOp { /* private fields */ }Implementations§
Source§impl PrimOp
impl PrimOp
Sourcepub fn new<const N: usize>(
eval_state: &mut EvalState,
meta: PrimOpMeta<'_, N>,
f: Box<dyn Fn(&mut EvalState, &[Value; N]) -> Result<Value>>,
) -> Result<PrimOp>
pub fn new<const N: usize>( eval_state: &mut EvalState, meta: PrimOpMeta<'_, N>, f: Box<dyn Fn(&mut EvalState, &[Value; N]) -> Result<Value>>, ) -> Result<PrimOp>
Create a new primop with the given metadata and implementation.
When f returns an Err, the error is propagated to the Nix evaluator.
To return a recoverable error, include it in the
error chain (e.g. Err(RecoverableError::new("...").into())).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrimOp
impl RefUnwindSafe for PrimOp
impl !Send for PrimOp
impl !Sync for PrimOp
impl Unpin for PrimOp
impl UnwindSafe for PrimOp
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