Skip to main content

ObservationAuthority

Struct ObservationAuthority 

Source
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>

Source

pub fn issued(request: ObserveEstablished<P>) -> Self

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.

Source

pub fn relationship(&self) -> &ObservationRelationship<P>

Source

pub fn into_relationship(self) -> ObservationRelationship<P>

Discharge permission and retain the exact non-authorizing relationship.

Trait Implementations§

Source§

impl<P: Protocol> Debug for ObservationAuthority<P>

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.