pub enum Source {
Web {
tab_id: i32,
document_id: String,
origin: String,
},
BrowserForeground {
id: i32,
},
BrowserBackground {
id: HostId,
},
DesktopRenderer,
DesktopMain,
}Expand description
Describes the source of an incoming IPC message with per-variant metadata.
Source mirrors Endpoint but carries additional context about the sender
that the application layer needs for security decisions (e.g., checking origin
for web sources). Use [From<Source> for Endpoint] to convert a source into an
addressable endpoint (dropping the metadata).
Variants§
Web
A web source identified by tab ID and document ID, with the origin of the sending page.
Fields
BrowserForeground
Browser foreground source (popup, sidebar, or extension page).
BrowserBackground
Browser background source (service worker/background context).
DesktopRenderer
Desktop renderer source (singleton).
DesktopMain
Desktop main-process source (singleton).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Source
impl<'de> Deserialize<'de> for Source
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 Sourcewhere
Self: DeserializeOwned,
impl FromWasmAbi for Sourcewhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &Source
impl IntoWasmAbi for &Source
Source§impl IntoWasmAbi for Source
impl IntoWasmAbi for Source
Source§impl OptionFromWasmAbi for Sourcewhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for Sourcewhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for Source
impl OptionIntoWasmAbi for Source
Source§impl RefFromWasmAbi for Sourcewhere
Self: DeserializeOwned,
impl RefFromWasmAbi for Sourcewhere
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 Source
impl Tsify for Source
const DECL: &'static str = "/**\n * Describes the source of an incoming IPC message with per-variant metadata.\n *\n * `Source` mirrors [`Endpoint`] but carries additional context about the sender\n * that the application layer needs for security decisions (e.g., checking `origin`\n * for web sources). Use [`From<Source> for Endpoint`] to convert a source into an\n * addressable endpoint (dropping the metadata).\n */\nexport type Source = { Web: { tab_id: number; document_id: string; origin: 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 Sourcewhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for Sourcewhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for Source
impl VectorIntoWasmAbi for Source
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for Source
impl WasmDescribeVector for Source
impl Eq for Source
impl StructuralPartialEq for Source
Auto Trait Implementations§
impl Freeze for Source
impl RefUnwindSafe for Source
impl Send for Source
impl Sync for Source
impl Unpin for Source
impl UnsafeUnpin for Source
impl UnwindSafe for Source
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.