pub struct ReplayTransport { /* private fields */ }Expand description
A Transport that replays recorded inbound frames and collects outbound
frames. See the module docs for gating and drain semantics.
Implementations§
Source§impl ReplayTransport
impl ReplayTransport
Sourcepub fn from_frames(frames: Vec<Vec<u8>>) -> (Self, ReplayControl)
pub fn from_frames(frames: Vec<Vec<u8>>) -> (Self, ReplayControl)
Build a replay transport from raw inbound frames.
The first frame should be the setupComplete handshake; it is
delivered ungated so the connection can reach Active.
Sourcepub fn from_wire_log(entries: &[WireEntry]) -> (Self, ReplayControl)
pub fn from_wire_log(entries: &[WireEntry]) -> (Self, ReplayControl)
Build a replay transport from a recorded wire log, keeping only the
WireDirection::Inbound entries (in log order).
Each frame keeps its recorded capture time, reported to a
with_frame_gate callback.
Sourcepub fn with_frame_gate(self, gate: FrameGate) -> Self
pub fn with_frame_gate(self, gate: FrameGate) -> Self
Pass each frame’s recorded capture time to gate and wait for it
before delivering the frame. Frames built with
from_frames carry no timestamps, so the gate is
not called for them.
Sourcepub fn with_ungated_prefix(self, n: usize) -> Self
pub fn with_ungated_prefix(self, n: usize) -> Self
Override how many leading frames are delivered before
ReplayControl::release (default 1: the setup handshake).
Trait Implementations§
Source§impl Transport for ReplayTransport
impl Transport for ReplayTransport
Source§type Error = ReplayTransportError
type Error = ReplayTransportError
Source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_url: &'life1 str,
_headers: Vec<(String, String)>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 mut self,
_url: &'life1 str,
_headers: Vec<(String, String)>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn send<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 mut self,
data: Vec<u8>,
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn recv<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
None when the connection is closed.Auto Trait Implementations§
impl Freeze for ReplayTransport
impl !RefUnwindSafe for ReplayTransport
impl Send for ReplayTransport
impl Sync for ReplayTransport
impl Unpin for ReplayTransport
impl !UnwindSafe for ReplayTransport
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].