pub enum Port {
Worker(Worker),
DedicatedWorkerGlobalScope(DedicatedWorkerGlobalScope),
MessagePort(MessagePort),
}Expand description
The Javascript types that send and receive messages.
A port is a transport that web-rpc is handed, never one that it owns: each variant is a cheap handle to a Javascript object, and dropping the last clone does nothing.
- Nothing here terminates a
web_sys::Worker. Whoever created the worker terminates it. - Nothing here calls
web_sys::MessagePort::start. AMessagePortmust be started by its owner before it is handed over, otherwise it delivers nothing to the listener thatcrate::Interface::newinstalls and the handshake never completes.
Variants§
Implementations§
Trait Implementations§
Source§impl From<DedicatedWorkerGlobalScope> for Port
impl From<DedicatedWorkerGlobalScope> for Port
Source§fn from(scope: DedicatedWorkerGlobalScope) -> Self
fn from(scope: DedicatedWorkerGlobalScope) -> Self
Converts to this type from the input type.
Source§impl From<MessagePort> for Port
impl From<MessagePort> for Port
Source§fn from(port: MessagePort) -> Self
fn from(port: MessagePort) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Send for Port
impl !Sync for Port
impl Freeze for Port
impl RefUnwindSafe for Port
impl Unpin for Port
impl UnsafeUnpin for Port
impl UnwindSafe for Port
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