pub struct ArcRwLockStream(/* private fields */);Implementations§
Source§impl ArcRwLockStream
impl ArcRwLockStream
Sourcepub fn from_stream(stream: TcpStream) -> Self
pub fn from_stream(stream: TcpStream) -> Self
Sourcepub async fn read(&self) -> RwLockReadGuardTcpStream<'_>
pub async fn read(&self) -> RwLockReadGuardTcpStream<'_>
Returns a reference to the inner TcpStream.
This method acquires a read lock on the underlying stream, allowing shared access to the TCP stream while preventing concurrent writes.
§Returns
Returns a read guard that provides shared access to the TCP stream
Sourcepub async fn send(&self, data: &ResponseData) -> ResponseResult
pub async fn send(&self, data: &ResponseData) -> ResponseResult
Sourcepub async fn send_body_with_websocket_flag(
&self,
body: &ResponseBody,
is_websocket: bool,
) -> ResponseResult
pub async fn send_body_with_websocket_flag( &self, body: &ResponseBody, is_websocket: bool, ) -> ResponseResult
Sourcepub async fn send_body(&self, body: &ResponseBody) -> ResponseResult
pub async fn send_body(&self, body: &ResponseBody) -> ResponseResult
Sourcepub async fn send_websocket_body(&self, body: &ResponseBody) -> ResponseResult
pub async fn send_websocket_body(&self, body: &ResponseBody) -> ResponseResult
Trait Implementations§
Source§impl Clone for ArcRwLockStream
impl Clone for ArcRwLockStream
Source§fn clone(&self) -> ArcRwLockStream
fn clone(&self) -> ArcRwLockStream
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ArcRwLockStream
impl !RefUnwindSafe for ArcRwLockStream
impl Send for ArcRwLockStream
impl Sync for ArcRwLockStream
impl Unpin for ArcRwLockStream
impl !UnwindSafe for ArcRwLockStream
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