pub struct ConnectionGrants { /* private fields */ }Expand description
One admitted connection’s binding and its current rights (ACCESS-005 R3, R4).
Every hot operation of the connection is decided here, locally, at the authority’s ordered generation, without the authority’s guard and without asking Lys.
Implementations§
Source§impl ConnectionGrants
impl ConnectionGrants
Sourcepub fn binding(&self) -> &GrantDecisionBinding
pub fn binding(&self) -> &GrantDecisionBinding
The binding the connection was admitted on; never replaced.
Sourcepub fn allows(
&self,
action: HotAction,
subject: &str,
) -> Result<(), RevocationRefusal>
pub fn allows( &self, action: HotAction, subject: &str, ) -> Result<(), RevocationRefusal>
Whether action on subject is allowed now.
§Errors
RevocationRefusal::GrantRevoked when every bound right covering
it was withdrawn or the connection is closing for a revocation;
RevocationRefusal::LogReset when it is closing for a log reset;
RevocationRefusal::BindingMissing when no bound right covers it.
Sourcepub fn permits(&self, action: HotAction, subject: &str) -> bool
pub fn permits(&self, action: HotAction, subject: &str) -> bool
Whether action on subject is allowed now, without counting it as
an operation: the connection’s own sweep reads this to retire the
work of withdrawn rights.
Sourcepub fn close_pending(&self) -> Option<RevocationRefusal>
pub fn close_pending(&self) -> Option<RevocationRefusal>
The reason the connection must close for, once its admitting right is lost or its log was reset.