pub struct UpgradeConnection { /* private fields */ }Expand description
A live upgraded WebSocket connection managed by the policy under test.
Obtained from [UnitTest::upgrade] or [UnitTest::upgrade_partial]. Use
client and server to exchange frames.
Pending outgoing calls triggered during body processing are resolved inline;
call [UnitTest::tick] for calls that require simulated time to elapse.
Implementations§
Source§impl UpgradeConnection
impl UpgradeConnection
Sourcepub fn response(&self) -> &UnitHttpResponse
pub fn response(&self) -> &UnitHttpResponse
Returns the HTTP 101 response that completed the upgrade handshake.
Sourcepub fn client(&self) -> ClientHandle
pub fn client(&self) -> ClientHandle
Returns a client-side handle for sending frames to the server and reading frames back.
Sourcepub fn server(&self) -> ServerHandle
pub fn server(&self) -> ServerHandle
Returns a server-side handle for sending frames to the client and reading frames forwarded toward the server.
Trait Implementations§
Source§impl Drop for UpgradeConnection
impl Drop for UpgradeConnection
Auto Trait Implementations§
impl !RefUnwindSafe for UpgradeConnection
impl !Send for UpgradeConnection
impl !Sync for UpgradeConnection
impl !UnwindSafe for UpgradeConnection
impl Freeze for UpgradeConnection
impl Unpin for UpgradeConnection
impl UnsafeUnpin for UpgradeConnection
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