pub trait HostType:
Send
+ Sync
+ Debug
+ Display {
// Required methods
fn type_name(&self) -> &'static str;
fn eq_atom(&self, other: &dyn HostType) -> bool;
fn encode(&self, out: &mut Vec<u8>);
fn as_any(&self) -> &dyn Any;
}Expand description
Data, emphatically: an atom declares a wire encoding because it must cross
a channel as a message payload. What cannot encode is a capability, and
capabilities are addresses.
Required Methods§
Sourcefn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Wire tag and registry key, stable across processes. Table indices are process-local, names are not.
Sourcefn eq_atom(&self, other: &dyn HostType) -> bool
fn eq_atom(&self, other: &dyn HostType) -> bool
Implementations downcast and return false on a foreign type rather
than comparing tags.