pub enum Endpoint {
Web {
tab_id: i32,
document_id: String,
},
BrowserForeground {
id: i32,
},
BrowserBackground {
id: HostId,
},
Cli {
id: HostId,
},
DesktopRenderer,
DesktopMain,
}Expand description
IPC destination/source endpoint for SDK clients.
Endpoints are categorized by their role in the connection topology:
- Host endpoints (
HostId): Connection hubs that can be addressed relationally or specifically. (BrowserBackground,Cli) - Leaf endpoints: Addressed by transport-assigned IDs. (
Web,BrowserForeground) - Singleton endpoints: Exactly one instance globally, no ID needed.
(
DesktopMain,DesktopRenderer)
Variants§
Web
A web endpoint identified by a Chrome tab ID (for routing via
chrome.tabs.sendMessage) and a document ID (for identity validation).
The document ID invalidates on navigation, allowing the browser background
to reject delivery if the page changed since the message was addressed.
Fields
BrowserForeground
Browser foreground endpoint (popup, sidebar, or extension page) identified by a transport-assigned numeric ID.
BrowserBackground
Browser background endpoint (service worker/background context).
Cli
CLI endpoint. Each CLI invocation is its own process, so instances are distinguished by a host identifier.
DesktopRenderer
Desktop renderer endpoint (singleton).
DesktopMain
Desktop main-process endpoint (singleton).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Endpoint
impl<'de> Deserialize<'de> for Endpoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Endpoint
impl StructuralPartialEq for Endpoint
Source§impl Tsify for Endpoint
impl Tsify for Endpoint
const DECL: &'static str = "/**\n * IPC destination/source endpoint for SDK clients.\n *\n * Endpoints are categorized by their role in the connection topology:\n * - **Host endpoints** ([`HostId`]): Connection hubs that can be addressed relationally or\n * specifically. ([`BrowserBackground`](Endpoint::BrowserBackground), [`Cli`](Endpoint::Cli))\n * - **Leaf endpoints**: Addressed by transport-assigned IDs. ([`Web`](Endpoint::Web),\n * [`BrowserForeground`](Endpoint::BrowserForeground))\n * - **Singleton endpoints**: Exactly one instance globally, no ID needed.\n * ([`DesktopMain`](Endpoint::DesktopMain), [`DesktopRenderer`](Endpoint::DesktopRenderer))\n */\nexport type Endpoint = { Web: { tab_id: number; document_id: string } } | { BrowserForeground: { id: number } } | { BrowserBackground: { id: HostId } } | { Cli: { id: HostId } } | \"DesktopRenderer\" | \"DesktopMain\";"
const SERIALIZATION_CONFIG: SerializationConfig
Source§type JsType = JsType
type JsType = JsType
#[wasm_bindgen] extern "C" { .. }.
[Ts<T>] is #[repr(transparent)] over this and passes it across the
ABI as a plain JS handle, which any other representation would break.fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Auto Trait Implementations§
impl Freeze for Endpoint
impl RefUnwindSafe for Endpoint
impl Send for Endpoint
impl Sync for Endpoint
impl Unpin for Endpoint
impl UnsafeUnpin for Endpoint
impl UnwindSafe for Endpoint
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more