pub struct DuplexGate { /* private fields */ }Expand description
The gate over duplex calls: a Gate (and its grants generation, which
says when to ask it again), the audit, and the clock expiry is read by.
Implementations§
Source§impl DuplexGate
impl DuplexGate
Sourcepub fn new(gate: Gate) -> Self
pub fn new(gate: Gate) -> Self
The gate over duplex calls in front of gate; re-verifies when
gate’s generation (Gate::generation) moves.
Sourcepub fn with_audit(self, audit: AuditQueue) -> Self
pub fn with_audit(self, audit: AuditQueue) -> Self
Every typed refusal to audit (one record each, never waiting).
Sourcepub fn with_clock(self, clock: Clock) -> Self
pub fn with_clock(self, clock: Clock) -> Self
When a sign-in expires is read by clock (unix seconds; a test’s).
Sourcepub fn gate(&self) -> &Gate
pub fn gate(&self) -> &Gate
The grant gate it asks (its Gate::generation, Gate::moved).
Sourcepub fn gate_checks(&self) -> u64
pub fn gate_checks(&self) -> u64
How many times the gate has been asked through this one.
Sourcepub fn open(
&self,
at: impl Into<CallRef>,
calls: &dyn CallCounter,
caller: Option<Arc<AuthContext>>,
grant: &str,
target: Option<&str>,
ceiling: CallCeiling,
answer_by: Answerer,
) -> Result<DuplexCall, DuplexRefusal>
pub fn open( &self, at: impl Into<CallRef>, calls: &dyn CallCounter, caller: Option<Arc<AuthContext>>, grant: &str, target: Option<&str>, ceiling: CallCeiling, answer_by: Answerer, ) -> Result<DuplexCall, DuplexRefusal>
Open a duplex call: the gate first (a refusal takes no place), then
the call’s place on its connection. at is the call — its
connection and subscription (a ConnId alone is subscription 0).
Sourcepub fn admitted(
&self,
at: impl Into<CallRef>,
calls: &dyn CallCounter,
caller: Option<Arc<AuthContext>>,
grant: &str,
targets: Vec<String>,
seen: u64,
recheck: bool,
ceiling: CallCeiling,
answer_by: Answerer,
) -> Result<DuplexCall, DuplexRefusal>
pub fn admitted( &self, at: impl Into<CallRef>, calls: &dyn CallCounter, caller: Option<Arc<AuthContext>>, grant: &str, targets: Vec<String>, seen: u64, recheck: bool, ceiling: CallCeiling, answer_by: Answerer, ) -> Result<DuplexCall, DuplexRefusal>
BIDIR-6: open a call the service’s dispatch has already decided, so
the decision is still made once. seen is the generation read before
that decision: a move since is found at the first frame (or at once,
by DuplexCall::input). recheck false: the method is one the gate
admits whoever calls (public, a signed-in grant), so a move asks
nothing; the sign-in’s expiry still holds. targets: every value the
dispatch checked, asked again together.