pub enum Source {
Web {
tab_id: i32,
document_id: String,
origin: String,
},
BrowserForeground {
id: i32,
},
BrowserBackground {
id: HostId,
},
Cli {
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).
Cli
CLI source, identified by a host identifier.
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
impl Eq for Source
impl StructuralPartialEq for Source
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 } } | { Cli: { id: HostId } } | \"DesktopRenderer\" | \"DesktopMain\";"
const SERIALIZATION_CONFIG: SerializationConfig
Source§type JsType = JsType
type JsType = JsType
Must be a type imported through
#[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 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
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
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, 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
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Consume a handle, getting back the initial
Arc<> Read more