pub trait Object: Send + Sync {
// Required methods
fn display(&self, _cx: &mut Cx) -> Result<String>;
fn as_any(&self) -> &dyn Any;
// Provided methods
fn header(&self) -> &ObjectHeader { ... }
fn op(&self, _key: &OpKey) -> Option<&dyn Op> { ... }
fn claims(
&self,
_cx: &mut Cx,
_pattern: &ClaimPattern,
_sink: &mut dyn ClaimSink,
) -> Result<()> { ... }
fn snapshot(&self, _cx: &mut Cx) -> Result<Option<Datum>> { ... }
}Expand description
Base protocol implemented by every runtime value.
SIM uses object-style protocol views instead of a closed value enum for extensible runtime behavior. The root trait stays small: behavior is exposed through headers, operations, claims, snapshots, display, and Rust downcasting.
Required Methods§
Provided Methods§
Sourcefn header(&self) -> &ObjectHeader
fn header(&self) -> &ObjectHeader
Identity and trust header for the object; defaults to the shared anonymous header.
Sourcefn op(&self, _key: &OpKey) -> Option<&dyn Op>
fn op(&self, _key: &OpKey) -> Option<&dyn Op>
Resolve the operation registered under key, if any.
Implementations§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".