From 27f4aeb92469660fdd78a89a7b2902c08a23ca4a Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Tue, 18 Aug 2020 18:30:13 +0200 Subject: Make Rc/Arc wrapper around State/GlobalState visible (#7104) --- cli/ops/net.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'cli/ops/net.rs') diff --git a/cli/ops/net.rs b/cli/ops/net.rs index 76abcb6c3..445c69106 100644 --- a/cli/ops/net.rs +++ b/cli/ops/net.rs @@ -13,6 +13,7 @@ use futures::future::FutureExt; use std::convert::From; use std::net::Shutdown; use std::net::SocketAddr; +use std::rc::Rc; use std::task::Context; use std::task::Poll; use tokio::net::TcpListener; @@ -22,7 +23,7 @@ use tokio::net::UdpSocket; #[cfg(unix)] use super::net_unix; -pub fn init(i: &mut CoreIsolate, s: &State) { +pub fn init(i: &mut CoreIsolate, s: &Rc) { i.register_op("op_accept", s.stateful_json_op2(op_accept)); i.register_op("op_connect", s.stateful_json_op2(op_connect)); i.register_op("op_shutdown", s.stateful_json_op2(op_shutdown)); @@ -102,7 +103,7 @@ fn accept_tcp( fn op_accept( isolate_state: &mut CoreIsolateState, - _state: &State, + _state: &Rc, args: Value, zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -126,7 +127,7 @@ struct ReceiveArgs { fn receive_udp( isolate_state: &mut CoreIsolateState, - _state: &State, + _state: &Rc, args: ReceiveArgs, zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -166,7 +167,7 @@ fn receive_udp( fn op_datagram_receive( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc, args: Value, zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -196,7 +197,7 @@ struct SendArgs { fn op_datagram_send( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc, args: Value, zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -266,7 +267,7 @@ struct ConnectArgs { fn op_connect( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -352,7 +353,7 @@ struct ShutdownArgs { fn op_shutdown( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { @@ -494,7 +495,7 @@ fn listen_udp( fn op_listen( isolate_state: &mut CoreIsolateState, - state: &State, + state: &Rc, args: Value, _zero_copy: &mut [ZeroCopyBuf], ) -> Result { -- cgit v1.2.3