pub struct WireHandoffDelivery<S> { /* private fields */ }Expand description
HandoffDelivery implementation that sends HandoffOffer frames to
the backend over a framed control connection and waits for the matching
HandoffAck.
deliver writes one offer frame; await_backend_ack reads one response
frame and requires the token echo, the correlation id, and the accepted
flag to all match. Every violation is a delivery error — the
orchestration falls back to reconnect and revokes the token.
Implementations§
Source§impl<S> WireHandoffDelivery<S>
impl<S> WireHandoffDelivery<S>
Sourcepub fn new(
stream: S,
service_name: impl Into<String>,
correlation_id: u64,
) -> Self
pub fn new( stream: S, service_name: impl Into<String>, correlation_id: u64, ) -> Self
Wrap a framed broker↔backend connection for one handoff.
correlation_id ties the offer to its ACK; reuse the request or
connection id of the client Hello that triggered the handoff.
Sourcepub fn correlation_id(&self) -> u64
pub fn correlation_id(&self) -> u64
Return the correlation id stamped on the offer and required on the ACK.
Sourcepub fn stream(&self) -> &S
pub fn stream(&self) -> &S
Borrow the underlying connection (e.g. to read its raw fd for the
Unix SCM_RIGHTS send that precedes the offer frame).
Sourcepub fn into_stream(self) -> S
pub fn into_stream(self) -> S
Unwrap the underlying connection (e.g. to keep using it after a completed handoff).
Trait Implementations§
Source§impl<S: Debug> Debug for WireHandoffDelivery<S>
impl<S: Debug> Debug for WireHandoffDelivery<S>
Source§impl<S: Read + Write> HandoffDelivery for WireHandoffDelivery<S>
impl<S: Read + Write> HandoffDelivery for WireHandoffDelivery<S>
Source§fn deliver(
&mut self,
handle: WindowsHandleValue,
token: &HandoffToken,
) -> Result<(), HandoffDeliveryError>
fn deliver( &mut self, handle: WindowsHandleValue, token: &HandoffToken, ) -> Result<(), HandoffDeliveryError>
Source§fn await_backend_ack(
&mut self,
token: &HandoffToken,
deadline: Instant,
) -> Result<Instant, HandoffDeliveryError>
fn await_backend_ack( &mut self, token: &HandoffToken, deadline: Instant, ) -> Result<Instant, HandoffDeliveryError>
deadline. Read moreAuto Trait Implementations§
impl<S> Freeze for WireHandoffDelivery<S>where
S: Freeze,
impl<S> RefUnwindSafe for WireHandoffDelivery<S>where
S: RefUnwindSafe,
impl<S> Send for WireHandoffDelivery<S>where
S: Send,
impl<S> Sync for WireHandoffDelivery<S>where
S: Sync,
impl<S> Unpin for WireHandoffDelivery<S>where
S: Unpin,
impl<S> UnsafeUnpin for WireHandoffDelivery<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for WireHandoffDelivery<S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more