Struct sub_script::rpc::RpcConnection
source · [−]pub struct RpcConnection(_);
Implementations
sourceimpl RpcConnection
impl RpcConnection
pub fn new(id: ConnectionId, url: &str) -> Result<Self, Box<EvalAltResult>>
Trait Implementations
sourceimpl Clone for RpcConnection
impl Clone for RpcConnection
sourcefn clone(&self) -> RpcConnection
fn clone(&self) -> RpcConnection
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Deref for RpcConnection
impl Deref for RpcConnection
type Target = InnerRpcConnection
type Target = InnerRpcConnection
The resulting type after dereferencing.
sourcefn deref(&self) -> &InnerRpcConnection
fn deref(&self) -> &InnerRpcConnection
Dereferences the value.
sourceimpl Factory for RpcConnection
impl Factory for RpcConnection
type Handler = RpcConnection
sourcefn connection_made(&mut self, ws: Sender) -> RpcConnection
fn connection_made(&mut self, ws: Sender) -> RpcConnection
Called when a TCP connection is made.
sourcefn on_shutdown(&mut self)
fn on_shutdown(&mut self)
Called when the WebSocket is shutting down.
sourcefn client_connected(&mut self, ws: Sender) -> Self::Handler
fn client_connected(&mut self, ws: Sender) -> Self::Handler
Called when a new connection is established for a client endpoint. This method can be used to differentiate a client aspect for a handler. Read more
sourcefn server_connected(&mut self, ws: Sender) -> Self::Handler
fn server_connected(&mut self, ws: Sender) -> Self::Handler
Called when a new connection is established for a server endpoint. This method can be used to differentiate a server aspect for a handler. Read more
sourcefn connection_lost(&mut self, Self::Handler)
fn connection_lost(&mut self, Self::Handler)
Called when a TCP connection is lost with the handler that was setup for that connection. Read more
sourceimpl Handler for RpcConnection
impl Handler for RpcConnection
sourcefn on_shutdown(&mut self)
fn on_shutdown(&mut self)
Called when a request to shutdown all connections has been received.
sourcefn on_open(&mut self, shake: Handshake) -> Result<(), Error>
fn on_open(&mut self, shake: Handshake) -> Result<(), Error>
Called when the WebSocket handshake is successful and the connection is open for sending and receiving messages. Read more
sourcefn on_close(&mut self, code: CloseCode, reason: &str)
fn on_close(&mut self, code: CloseCode, reason: &str)
Called any time this endpoint receives a close control frame. This may be because the other endpoint is initiating a closing handshake, or it may be the other endpoint confirming the handshake initiated by this endpoint. Read more
sourcefn on_request(&mut self, req: &Request) -> Result<Response, Error>
fn on_request(&mut self, req: &Request) -> Result<Response, Error>
A method for handling the low-level workings of the request portion of the WebSocket handshake. Read more
sourcefn on_response(&mut self, res: &Response) -> Result<(), Error>
fn on_response(&mut self, res: &Response) -> Result<(), Error>
A method for handling the low-level workings of the response portion of the WebSocket handshake. Read more
sourcefn on_timeout(&mut self, event: Token) -> Result<(), Error>
fn on_timeout(&mut self, event: Token) -> Result<(), Error>
Called when a timeout is triggered. Read more
sourcefn on_new_timeout(&mut self, Token, Timeout) -> Result<(), Error>
fn on_new_timeout(&mut self, Token, Timeout) -> Result<(), Error>
Called when a timeout has been scheduled on the eventloop. Read more
sourcefn on_frame(&mut self, frame: Frame) -> Result<Option<Frame>, Error>
fn on_frame(&mut self, frame: Frame) -> Result<Option<Frame>, Error>
A method for handling incoming frames. Read more
sourcefn on_send_frame(&mut self, frame: Frame) -> Result<Option<Frame>, Error>
fn on_send_frame(&mut self, frame: Frame) -> Result<Option<Frame>, Error>
A method for handling outgoing frames. Read more
sourcefn build_request(&mut self, url: &Url) -> Result<Request, Error>
fn build_request(&mut self, url: &Url) -> Result<Request, Error>
A method for creating the initial handshake request for WebSocket clients. Read more
Auto Trait Implementations
impl !RefUnwindSafe for RpcConnection
impl Send for RpcConnection
impl Sync for RpcConnection
impl Unpin for RpcConnection
impl !UnwindSafe for RpcConnection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcefn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more