feat: unify object observation API
This commit is contained in:
@@ -352,7 +352,7 @@ impl InterfaceRegistry {
|
||||
|
||||
/// Observes a registered interface by its host-side reference.
|
||||
#[must_use]
|
||||
pub fn observe(&self, reference: &InterfaceRef) -> Option<InterfaceObservation> {
|
||||
pub fn observe_object(&self, reference: &InterfaceRef) -> Option<InterfaceObservation> {
|
||||
self.artifacts.get(reference).map(Self::observation)
|
||||
}
|
||||
|
||||
@@ -863,13 +863,13 @@ pub trait ObjectProvider {
|
||||
true
|
||||
}
|
||||
|
||||
/// Fetches the canonical object projection currently published at `path`.
|
||||
fn fetch(&self, path: &str) -> Result<Object, CallError> {
|
||||
self.fetch_with_context(&ExecutionContext::default(), path)
|
||||
/// Observes the canonical object projection currently published at `path`.
|
||||
fn observe_object(&self, path: &str) -> Result<Object, CallError> {
|
||||
self.observe_object_with_context(&ExecutionContext::default(), path)
|
||||
}
|
||||
|
||||
/// Fetches an object while propagating runtime execution controls.
|
||||
fn fetch_with_context(
|
||||
/// Observes an object while propagating runtime execution controls.
|
||||
fn observe_object_with_context(
|
||||
&self,
|
||||
context: &ExecutionContext,
|
||||
path: &str,
|
||||
@@ -882,7 +882,7 @@ pub trait ObjectProvider {
|
||||
.map_err(|_| {
|
||||
CallError::new(
|
||||
CallErrorKind::Internal,
|
||||
"provider panicked while fetching an object",
|
||||
"provider panicked while observing an object",
|
||||
)
|
||||
})?;
|
||||
let object = match resolved {
|
||||
|
||||
Reference in New Issue
Block a user