pub struct PeerCall { /* private fields */ }Expand description
One request to one peer.
Implementations§
Source§impl PeerCall
impl PeerCall
Sourcepub fn prepare(
registry: &PeerRegistry,
client: Arc<dyn PeerClient>,
caller: &Delegation,
peer: PeerId,
capability: impl Into<String>,
payload: Value,
) -> Result<Self, PeerError>
pub fn prepare( registry: &PeerRegistry, client: Arc<dyn PeerClient>, caller: &Delegation, peer: PeerId, capability: impl Into<String>, payload: Value, ) -> Result<Self, PeerError>
Prepare a hop, attenuating the caller’s authority onto the peer.
§Errors
PeerError::Unknownif the peer is not registered — fail closed.PeerError::Delegationif the grant would widen the caller’s own authority, or if the chain is already at its depth limit.PeerError::WrongAudienceif the credential held is for someone else.
Sourcepub fn prepare_with_credential(
registry: &PeerRegistry,
client: Arc<dyn PeerClient>,
caller: &Delegation,
peer: PeerId,
capability: impl Into<String>,
payload: Value,
credential: Option<PeerCredential>,
) -> Result<Self, PeerError>
pub fn prepare_with_credential( registry: &PeerRegistry, client: Arc<dyn PeerClient>, caller: &Delegation, peer: PeerId, capability: impl Into<String>, payload: Value, credential: Option<PeerCredential>, ) -> Result<Self, PeerError>
Prepare a hop with a credential the caller obtained itself.
For a CredentialSource, which mints
against an expiry and therefore has to run at call time rather than at
configuration time. The audience is re-checked here regardless of where
the credential came from: a source is another place a mistake can be
made, and this is the last point before it goes on the wire.
§Errors
As PeerCall::prepare, plus PeerError::WrongAudience if the
supplied credential is bound to a different peer.
Sourcepub const fn acting_as(&self) -> &Delegation
pub const fn acting_as(&self) -> &Delegation
The chain the peer will act under.
Trait Implementations§
Source§impl Effect for PeerCall
impl Effect for PeerCall
Source§fn trust(&self) -> Trust
fn trust(&self) -> Trust
A peer’s answer is another party’s data.
Stated rather than inherited because a peer feels more trusted than a tool — it is our agent, on our side. It is not: it runs somewhere else, under someone else’s control, and it may itself have read the internet.
Source§type Output = Value
type Output = Value
Source§fn descriptor(&self) -> EffectDescriptor
fn descriptor(&self) -> EffectDescriptor
Source§fn recovery(&self) -> Recovery
fn recovery(&self) -> Recovery
InDoubt failure. The two are the
same situation reached from different directions.Source§fn retry(&self) -> RetryPolicy
fn retry(&self) -> RetryPolicy
Source§fn max_sensitivity(&self) -> Sensitivity
fn max_sensitivity(&self) -> Sensitivity
Source§fn delegation_depth(&self) -> Option<usize>
fn delegation_depth(&self) -> Option<usize>
Source§fn output_sensitivity(&self) -> Sensitivity
fn output_sensitivity(&self) -> Sensitivity
Source§fn attach(&mut self, provenance: &Provenance)
fn attach(&mut self, provenance: &Provenance)
Source§fn perform<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EffectError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn perform<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EffectError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn gen_ai_operation(&self) -> Option<&'static str>
fn gen_ai_operation(&self) -> Option<&'static str>
Source§fn sink_arguments(&self) -> Option<&Value>
fn sink_arguments(&self) -> Option<&Value>
Source§fn protected_fields(&self) -> &[ProtectedField]
fn protected_fields(&self) -> &[ProtectedField]
Auto Trait Implementations§
impl !RefUnwindSafe for PeerCall
impl !UnwindSafe for PeerCall
impl Freeze for PeerCall
impl Send for PeerCall
impl Sync for PeerCall
impl Unpin for PeerCall
impl UnsafeUnpin for PeerCall
Blanket Implementations§
Source§impl<E> AnyEffect for Ewhere
E: Effect,
impl<E> AnyEffect for Ewhere
E: Effect,
Source§fn spend_erased(&self, output: &Value) -> Spend
fn spend_erased(&self, output: &Value) -> Spend
Round-trips the output to ask the typed effect what it cost.
A type that cannot be deserialized from its own serialization is already
broken for replay — Effect::Output requires the round-trip, and the
journal reconstructs every output that way. Charging zero here is the
same answer replay would reach, and the defect surfaces where it belongs.
fn descriptor(&self) -> EffectDescriptor
fn attach_erased(&mut self, provenance: &Provenance)
fn gen_ai_operation(&self) -> Option<&'static str>
fn mutates(&self) -> bool
fn recovery(&self) -> Recovery
fn retry(&self) -> RetryPolicy
fn max_sensitivity(&self) -> Sensitivity
fn sink_arguments(&self) -> Option<&Value>
fn protected_fields(&self) -> &[ProtectedField]
fn delegation_depth(&self) -> Option<usize>
fn source(&self) -> SourceId
fn trust(&self) -> Trust
fn output_sensitivity(&self) -> Sensitivity
fn perform_erased<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Value, EffectError>> + Send + 'async_trait>>where
'life0: 'async_trait,
E: 'async_trait,
fn reconcile_erased<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Reconciliation<Value>, EffectError>> + Send + 'async_trait>>where
'life0: 'async_trait,
E: 'async_trait,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<E> BuildsEffect<E> for Ewhere
E: Effect,
impl<E> BuildsEffect<E> for Ewhere
E: Effect,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more