pub struct ArcRwLockStream(/* private fields */);Expand description
Thread-safe TCP stream wrapper.
Provides shared access to a TcpStream using Arc and RwLock.
§Fields
Arc<RwLock<TcpStream>>- The protected TCP stream.
Implementations§
Source§impl ArcRwLockStream
impl ArcRwLockStream
Sourcepub fn from_stream(stream: TcpStream) -> ArcRwLockStream
pub fn from_stream(stream: TcpStream) -> ArcRwLockStream
Sourcepub async fn read(&self) -> RwLockReadGuard<'_, TcpStream>
pub async fn read(&self) -> RwLockReadGuard<'_, TcpStream>
Gets a read lock on the inner TcpStream.
Allows shared read access to the stream.
§Returns
RwLockReadGuardTcpStream- The read guard for the stream.
Sourcepub async fn try_send<D>(&self, data: D) -> Result<(), ResponseError>
pub async fn try_send<D>(&self, data: D) -> Result<(), ResponseError>
Sourcepub async fn try_send_body<D>(&self, data: D) -> Result<(), ResponseError>
pub async fn try_send_body<D>(&self, data: D) -> Result<(), ResponseError>
Sourcepub async fn try_send_body_list<I, D>(
&self,
data_iter: I,
) -> Result<(), ResponseError>
pub async fn try_send_body_list<I, D>( &self, data_iter: I, ) -> Result<(), ResponseError>
Sourcepub async fn send_body_list<I, D>(&self, data_iter: I)
pub async fn send_body_list<I, D>(&self, data_iter: I)
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 moreSource§impl Debug for ArcRwLockStream
impl Debug for ArcRwLockStream
Source§impl From<&ArcRwLockStream> for Context
Implementation of From trait for converting &ArcRwLockStream into Context.
impl From<&ArcRwLockStream> for Context
Implementation of From trait for converting &ArcRwLockStream into Context.
Source§impl From<ArcRwLockStream> for Context
Implementation of From trait for converting ArcRwLockStream into Context.
impl From<ArcRwLockStream> for Context
Implementation of From trait for converting ArcRwLockStream into Context.
Auto 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