pub struct ConnectionMembership { /* private fields */ }Expand description
One connection’s membership binding (ACCESS-006 R1, R6): the gate, the
connection’s id and the verified subject from its one Connect, or the
exact reason it has none.
Dropped with the connection’s state on every teardown path, releasing the bindings it held.
Implementations§
Source§impl ConnectionMembership
impl ConnectionMembership
Sourcepub fn bind(
gate: Option<Arc<MembershipGate>>,
pid: u64,
session: Option<&dyn LysSession>,
) -> Self
pub fn bind( gate: Option<Arc<MembershipGate>>, pid: u64, session: Option<&dyn LysSession>, ) -> Self
Binds connection pid at Connect: the subject is the admitted Lys
session’s holder, or none. Without a gate nothing is protected.
Sourcepub fn gate(&self) -> Option<&Arc<MembershipGate>>
pub fn gate(&self) -> Option<&Arc<MembershipGate>>
The gate, when one is bound.
Sourcepub fn holder(&self) -> Result<&MembershipSubject, MembershipRefusal>
pub fn holder(&self) -> Result<&MembershipSubject, MembershipRefusal>
The verified subject, or why there is none.
§Errors
MembershipRefusal::HolderUnverified without a gate or a holder;
the subject’s own refusal otherwise.
Sourcepub fn admit_connect(&self) -> Result<Option<u64>, MembershipRefusal>
pub fn admit_connect(&self) -> Result<Option<u64>, MembershipRefusal>
Scoped guest admission for this connection’s holder at Connect.
§Errors
As for MembershipGate::admit_connect; the holder’s own refusal.
Sourcepub fn check(
&self,
channel: &str,
action: MembershipAction,
) -> Result<Decided, MembershipRefusal>
pub fn check( &self, channel: &str, action: MembershipAction, ) -> Result<Decided, MembershipRefusal>
Decides action on channel for this connection.
§Errors
As for MembershipGate::check; a protected channel on a connection
with no verified subject refuses with that subject’s cause.
Sourcepub fn release(
&self,
channel: &str,
action: MembershipAction,
) -> Result<Decided, MembershipRefusal>
pub fn release( &self, channel: &str, action: MembershipAction, ) -> Result<Decided, MembershipRefusal>
Sourcepub fn release_conversation(
&self,
conversation: u64,
) -> Result<Decided, MembershipRefusal>
pub fn release_conversation( &self, conversation: u64, ) -> Result<Decided, MembershipRefusal>
Self::release for a participant conversation, on the channel the
mapping places it under; an unmapped conversation is not protected.
§Errors
As for Self::check.
Source§impl ConnectionMembership
impl ConnectionMembership
Sourcepub fn release_check(
&self,
channel: &str,
action: MembershipAction,
) -> Option<ReleaseCheck>
pub fn release_check( &self, channel: &str, action: MembershipAction, ) -> Option<ReleaseCheck>
The final release check a queued delivery owner carries for
action on the protected channel (ACCESS-006 R3): None when the
channel is not protected or the connection has no verified subject
(its admission was already refused, so no such owner exists).