Struct deno_web::MessagePort
source · pub struct MessagePort { /* private fields */ }
Implementations§
source§impl MessagePort
impl MessagePort
pub fn send(
&self,
state: &mut OpState,
data: JsMessageData
) -> Result<(), AnyError>
pub async fn recv(
&self,
state: Rc<RefCell<OpState>>
) -> Result<Option<JsMessageData>, AnyError>
sourcepub fn disentangle(&self)
pub fn disentangle(&self)
This forcefully disconnects the message port from its paired port. This
will wake up the .recv
on the paired port, which will return Ok(None)
.