pub enum HostId {
Own,
Id(i32),
}Expand description
Identifies a host endpoint, one that manages connections for other endpoints.
Host endpoints can be addressed relationally (when the sender has a direct connection and there is only one from their perspective) or by a specific transport-assigned ID (when distinguishing between multiple instances).
Variants§
Own
The sender’s own instance of this endpoint type. Used when there is exactly one from the sender’s perspective (e.g., a web tab addressing its browser background).
Id(i32)
A specific instance identified by a transport-assigned numeric value (e.g., native messaging client ID).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HostId
impl<'de> Deserialize<'de> for HostId
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 HostIdwhere
Self: DeserializeOwned,
impl FromWasmAbi for HostIdwhere
Self: DeserializeOwned,
Source§impl IntoWasmAbi for &HostId
impl IntoWasmAbi for &HostId
Source§impl IntoWasmAbi for HostId
impl IntoWasmAbi for HostId
Source§impl OptionFromWasmAbi for HostIdwhere
Self: DeserializeOwned,
impl OptionFromWasmAbi for HostIdwhere
Self: DeserializeOwned,
Source§impl OptionIntoWasmAbi for HostId
impl OptionIntoWasmAbi for HostId
Source§impl RefFromWasmAbi for HostIdwhere
Self: DeserializeOwned,
impl RefFromWasmAbi for HostIdwhere
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 HostId
impl Tsify for HostId
const DECL: &'static str = "/**\n * Identifies a host endpoint, one that manages connections for other endpoints.\n *\n * Host endpoints can be addressed relationally (when the sender has a direct connection\n * and there is only one from their perspective) or by a specific transport-assigned ID\n * (when distinguishing between multiple instances).\n */\nexport type HostId = \"Own\" | { Id: number };"
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 HostIdwhere
Self: DeserializeOwned,
impl VectorFromWasmAbi for HostIdwhere
Self: DeserializeOwned,
type Abi = <JsType as VectorFromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[Self]>
Source§impl VectorIntoWasmAbi for HostId
impl VectorIntoWasmAbi for HostId
type Abi = <JsType as VectorIntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[Self]>) -> Self::Abi
Source§impl WasmDescribeVector for HostId
impl WasmDescribeVector for HostId
impl Copy for HostId
impl Eq for HostId
impl StructuralPartialEq for HostId
Auto Trait Implementations§
impl Freeze for HostId
impl RefUnwindSafe for HostId
impl Send for HostId
impl Sync for HostId
impl Unpin for HostId
impl UnsafeUnpin for HostId
impl UnwindSafe for HostId
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.