#![allow(dead_code, unused_variables)]
use std::path::PathBuf;
use std::sync::Arc;
use anyhow::{bail, Result};
use async_std::task::JoinHandle;
use futures::channel::mpsc::Sender;
use nipper::Document;
use super::{LinkAttrs, TrunkLinkPipelineOutput};
use crate::config::{CargoMetadata, RtcBuild};
pub struct RustWorker {
id: usize,
cfg: Arc<RtcBuild>,
manifest: CargoMetadata,
ignore_chan: Option<Sender<PathBuf>>,
}
impl RustWorker {
pub const TYPE_RUST_WORKER: &'static str = "rust-worker";
pub async fn new(cfg: Arc<RtcBuild>, html_dir: Arc<PathBuf>, ignore_chan: Option<Sender<PathBuf>>, attrs: LinkAttrs, id: usize) -> Result<Self> {
bail!(r#"the rust web worker asset type `<link data-trunk rel="rust-worker" .../>` is not yet supported"#)
}
#[tracing::instrument(level = "trace", skip(self))]
pub fn spawn(self) -> JoinHandle<Result<TrunkLinkPipelineOutput>> {
unimplemented!()
}
}
pub struct RustWorkerOutput {
pub id: Option<usize>,
pub cfg: Arc<RtcBuild>,
pub js_output: String,
pub wasm_output: String,
}
impl RustWorkerOutput {
pub async fn finalize(self, dom: &mut Document) -> Result<()> {
unimplemented!()
}
}