pub struct Interface { /* private fields */ }
Expand description
An interface represents a crate::port::Port
that has been fully initialised and has
verified that the other end of the channel is ready to receive messages.
Implementations§
Source§impl Interface
impl Interface
Sourcepub async fn new(port: impl Into<Port>) -> Self
pub async fn new(port: impl Into<Port>) -> Self
Create a new interface from anything that implements Into<Port>
, for example, a
web_sys::MessagePort
, a web_sys::Worker
, or a
web_sys::DedicatedWorkerGlobalScope
. This function is async and resolves to the new
interface instance once the other side of the channel is ready.
Auto Trait Implementations§
impl Freeze for Interface
impl !RefUnwindSafe for Interface
impl !Send for Interface
impl !Sync for Interface
impl Unpin for Interface
impl !UnwindSafe for Interface
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