pub enum Endpoint {
Web {
tab_id: i32,
document_id: String,
},
BrowserForeground {
id: i32,
},
BrowserBackground {
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) - 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).
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl FromWasmAbi for Endpointwhere
Self: DeserializeOwned,
impl FromWasmAbi for Endpointwhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &Endpoint
impl IntoWasmAbi for &Endpoint
Source§impl IntoWasmAbi for Endpoint
impl IntoWasmAbi for Endpoint
Source§impl OptionFromWasmAbi for Endpointwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for Endpointwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for Endpoint
impl OptionIntoWasmAbi for Endpoint
Source§impl RefFromWasmAbi for Endpointwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for Endpointwhere
Self: DeserializeOwned,
Source§type Abi = <JsType as RefFromWasmAbi>::Abi
type Abi = <JsType as RefFromWasmAbi>::Abi
The Wasm ABI type references to
Self are recovered from.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))\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 } } | \"DesktopRenderer\" | \"DesktopMain\";"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
Source§impl VectorFromWasmAbi for Endpointwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for Endpointwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for Endpoint
impl VectorIntoWasmAbi for Endpoint
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for Endpoint
impl WasmDescribeVector for Endpoint
impl Eq for Endpoint
impl StructuralPartialEq for Endpoint
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
Checks if this value is equivalent to the given key. Read more
§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
Compare self to
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.