pub struct Worker { /* private fields */ }Expand description
A running worker. Dropping it closes Node’s stdin, waits up to 2 s for it to exit, then kills it.
Implementations§
Source§impl Worker
impl Worker
Sourcepub fn start(
node: &NodeInfo,
root: &Path,
run_mode: RunMode,
) -> Result<Worker, WorkerError>
pub fn start( node: &NodeInfo, root: &Path, run_mode: RunMode, ) -> Result<Worker, WorkerError>
Start Node with the worker, in root (the project folder), with
11ty’s environment variables added to Brrrty’s own.
Trait Implementations§
Source§impl JsRuntime for Worker
impl JsRuntime for Worker
Source§fn set_argument(&mut self, arg: &Value) -> JsResult<()>
fn set_argument(&mut self, arg: &Value) -> JsResult<()>
The data 11ty hands an exported function (
addGlobalData values and
eleventy), sent once before any file loads.Source§fn load(&mut self, file: &Path, call: bool) -> JsResult<Decoded>
fn load(&mut self, file: &Path, call: bool) -> JsResult<Decoded>
Import
file (absolute) as 11ty does; when call and the export is
a function, call it with the argument and await it.Source§fn call(&mut self, f: FnHandle, args: &[Value]) -> JsResult<Decoded>
fn call(&mut self, f: FnHandle, args: &[Value]) -> JsResult<Decoded>
Call a function value with
args, awaiting the result.Auto Trait Implementations§
impl !RefUnwindSafe for Worker
impl !Sync for Worker
impl !UnwindSafe for Worker
impl Forget for Worker
impl Freeze for Worker
impl Move for Worker
impl Send for Worker
impl Unpin for Worker
impl UnsafeUnpin for Worker
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