pub struct ObservationAuthority<P: Protocol> { /* private fields */ }Expand description
Affine permission to attempt cancellation of one exact relationship.
A permission does not assert that its registration remains live. It transfers once and cannot be reused after constructing cancellation:
ⓘ
fn duplicate<P: behavior::Protocol>(authority: behavior_actors::ObservationAuthority<P>) {
let first = behavior_actors::CancelObservation::new(authority);
let second = behavior_actors::CancelObservation::new(authority);
drop((first, second));
}A different protocol cannot consume the grant:
ⓘ
fn wrong_protocol<P: behavior::Protocol, Q: behavior::Protocol<Addr = P::Addr>>(authority: behavior_actors::ObservationAuthority<P>) -> behavior_actors::CancelObservation<Q> {
behavior_actors::CancelObservation::new(authority)
}A same-protocol grant transfers into exactly one cancellation request.
pub fn cancellation<P: behavior::Protocol>(authority: behavior_actors::ObservationAuthority<P>) {
let first = behavior_actors::CancelObservation::new(authority);
drop(first);
}pub fn cancellation<P: behavior::Protocol, Q: behavior::Protocol<Addr = P::Addr>>(authority: behavior_actors::ObservationAuthority<P>) -> behavior_actors::CancelObservation<P> {
behavior_actors::CancelObservation::new(authority)
}Implementations§
Source§impl<P: Protocol> ObservationAuthority<P>
impl<P: Protocol> ObservationAuthority<P>
Sourcepub fn issued(request: ObserveEstablished<P>) -> Selfwhere
P::Addr: RecipientAddress,
pub fn issued(request: ObserveEstablished<P>) -> Selfwhere
P::Addr: RecipientAddress,
Transfer the original private request identity into its affine authority.
This advanced-host operation consumes the original request. The host must commit the same identity to its exact membership owner before publishing Started. Perform issuance outside all Behavior folds. Never issue for a rejected request or return an admitted original.
pub fn relationship(&self) -> &ObservationRelationship<P>
Sourcepub fn into_relationship(self) -> ObservationRelationship<P>
pub fn into_relationship(self) -> ObservationRelationship<P>
Discharge permission and retain the exact non-authorizing relationship.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for ObservationAuthority<P>
impl<P> RefUnwindSafe for ObservationAuthority<P>
impl<P> Send for ObservationAuthority<P>
impl<P> Sync for ObservationAuthority<P>
impl<P> Unpin for ObservationAuthority<P>
impl<P> UnsafeUnpin for ObservationAuthority<P>
impl<P> UnwindSafe for ObservationAuthority<P>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more