pub trait Refer<State: StateInstance> {
// Required methods
fn dereference_self(self, path: &TCPathBuf) -> Self;
fn is_conditional(&self) -> bool;
fn is_inter_service_write(&self, cluster_path: &[PathSegment]) -> bool;
fn is_ref(&self) -> 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, State, T>,
txn: &'a State::Txn
) -> Pin<Box<dyn Future<Output = TCResult<State>> + Send + 'async_trait>>
where T: 'async_trait + ToState<State> + Public<State> + Instance,
Self: 'async_trait,
'a: 'async_trait;
}
Expand description
Trait defining dependencies and a resolution method for a TCRef
.
Required Methods§
sourcefn 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.
sourcefn is_conditional(&self) -> bool
fn is_conditional(&self) -> bool
Return true
if this is a conditional reference (e.g. If
or Case
).
sourcefn 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.
sourcefn 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.
sourcefn requires(&self, deps: &mut HashSet<Id>)
fn requires(&self, deps: &mut HashSet<Id>)
Add the dependency [Id
]s of this reference to the given set.
Object Safety§
This trait is not object safe.