pub(crate) struct DevtoolsConnection {
receiver: Arc<Mutex<TcpStream>>,
sender: Arc<Mutex<TcpStream>>,
}Expand description
Wraps a Remote Debugging Protocol TCP stream, guaranteeing that network operations are synchronized when cloning across threads.
Fields§
§receiver: Arc<Mutex<TcpStream>>Copy of TcpStream handle to use for receiving from the client.
TcpStream::read is a mutating I/O operation that doesn’t fit with RwLock.
We clone a single stream handle into two mutexes so we can still lock
reads and writes independently.
sender: Arc<Mutex<TcpStream>>Copy of TcpStream handle to use for sending bytes to the client.
Implementations§
Source§impl DevtoolsConnection
impl DevtoolsConnection
Sourcepub(crate) fn peer_addr(&self) -> Result<SocketAddr>
pub(crate) fn peer_addr(&self) -> Result<SocketAddr>
Calls TcpStream::peer_addr on the underlying stream.
Trait Implementations§
Source§impl Clone for DevtoolsConnection
impl Clone for DevtoolsConnection
Source§fn clone(&self) -> DevtoolsConnection
fn clone(&self) -> DevtoolsConnection
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 From<TcpStream> for DevtoolsConnection
impl From<TcpStream> for DevtoolsConnection
Source§impl JsonPacketStream for DevtoolsConnection
impl JsonPacketStream for DevtoolsConnection
fn write_json_packet<T: Serialize>( &mut self, message: &T, ) -> Result<(), ActorError>
fn read_json_packet(&mut self) -> Result<Option<Value>, String>
Source§impl MallocSizeOf for DevtoolsConnection
impl MallocSizeOf for DevtoolsConnection
Source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
Auto Trait Implementations§
impl Freeze for DevtoolsConnection
impl RefUnwindSafe for DevtoolsConnection
impl Send for DevtoolsConnection
impl Sync for DevtoolsConnection
impl Unpin for DevtoolsConnection
impl UnwindSafe for DevtoolsConnection
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert