pub trait Refer {
fn dereference_self(self, path: &TCPathBuf) -> Self;
fn is_conditional(&self) -> bool;
fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool;
fn reference_self(self, path: &TCPathBuf) -> Self;
fn requires(&self, deps: &mut HashSet<Id>);
fn resolve<'a, 'async_trait, T>(
self,
context: &'a Scope<'a, T>,
txn: &'a Txn
) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>>
where
'a: 'async_trait,
T: 'async_trait + ToState + Public + Instance,
Self: 'async_trait;
}
Expand description
Trait defining dependencies and a resolution method for a TCRef
.
Required Methods
fn dereference_self(self, path: &TCPathBuf) -> Self
fn dereference_self(self, path: &TCPathBuf) -> Self
Replace references to “$self” with the given relative path.
This is used to control whether or not an OpDef will be replicated.
fn is_conditional(&self) -> bool
fn is_conditional(&self) -> bool
Return true
if this is a conditional reference (e.g. If
or Case
).
fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool
fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool
Return true
if this references a write operation to a cluster other than the path given.
fn reference_self(self, path: &TCPathBuf) -> Self
fn reference_self(self, path: &TCPathBuf) -> Self
Replace the given relative path with “$self”.
This is used to control whether or not an OpDef will be replicated.
Add the dependency [Id
]s of this reference to the given set.
Resolve this reference with respect to the given context.