pub struct DuplexCall { /* private fields */ }Expand description
One open duplex call, holding its caller (the module docs).
Implementations§
Source§impl DuplexCall
impl DuplexCall
Sourcepub fn closed(&self) -> Option<&DuplexRefusal>
pub fn closed(&self) -> Option<&DuplexRefusal>
Why its input half closed, once it has.
Sourcepub fn grant_credit(&mut self, n: u64)
pub fn grant_credit(&mut self, n: u64)
The callee grants n more items (the credit { n } output item).
Sourcepub fn reverify(&mut self) -> Result<(), DuplexRefusal>
pub fn reverify(&mut self) -> Result<(), DuplexRefusal>
The caller, verified again (the generation moved): one gate check.
Sourcepub fn expire(&mut self) -> DuplexRefusal
pub fn expire(&mut self) -> DuplexRefusal
The sign-in’s expiry came: the caller proves no one now (the gate
would say the same — Gate::alive refuses a context past its
expires_at), so no check is asked. The input half closes.
Sourcepub fn admit(&mut self, f: &InputFrame) -> Result<(), DuplexRefusal>
pub fn admit(&mut self, f: &InputFrame) -> Result<(), DuplexRefusal>
Admit one input frame — no gate check unless the generation moved.
Sourcepub fn answer(
&self,
from: ConnId,
who: Option<&AuthContext>,
) -> Result<(), DuplexRefusal>
pub fn answer( &self, from: ConnId, who: Option<&AuthContext>, ) -> Result<(), DuplexRefusal>
May who, on connection from, answer a question this call asked?
By the method’s Answerer; a refusal is audited as who’s.
Sourcepub fn input<S>(
self,
frames: S,
refused: UnboundedSender<(ConnId, Value)>,
) -> impl Stream<Item = Result<Value, DuplexRefusal>> + Send + 'static
pub fn input<S>( self, frames: S, refused: UnboundedSender<(ConnId, Value)>, ) -> impl Stream<Item = Result<Value, DuplexRefusal>> + Send + 'static
The handler’s input: the frames as they come, each admitted; the
generation and the sign-in’s expiry selected beside them, so a quiet
call ends at a revoke. A frame from another connection is refused to
its sender on refused and the call runs on; any other refusal is
the stream’s last item, and what follows is never read (dropped).