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).
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
The error type produced by this transport.
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,
Connect to the given URL with optional headers.
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,
Send raw bytes.
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
Mutably borrows from an owned value. Read more