pub struct RpcEndpointConfig {
pub http_url: String,
pub websocket_url: Option<String>,
pub headers: Vec<(String, String)>,
}Expand description
Configuration for one caller-owned JSON-RPC endpoint.
The HTTP URL is the complete request target. Its path and query are preserved exactly and no eRPC route or API-key query parameter is added. A WebSocket URL, when supplied, is independent from the HTTP URL.
Fields§
§http_url: StringComplete HTTP(S) JSON-RPC request target.
websocket_url: Option<String>Optional complete WS(S) subscription target.
headers: Vec<(String, String)>Headers scoped to this endpoint’s HTTP JSON-RPC requests only.
Implementations§
Source§impl RpcEndpointConfig
impl RpcEndpointConfig
Sourcepub fn new(http_url: impl Into<String>) -> Self
pub fn new(http_url: impl Into<String>) -> Self
Starts an endpoint configuration with a complete HTTP(S) URL.
Sourcepub fn with_http_url(self, http_url: impl Into<String>) -> Self
pub fn with_http_url(self, http_url: impl Into<String>) -> Self
Replaces the complete HTTP(S) request target.
Sourcepub fn with_websocket_url(self, websocket_url: impl Into<String>) -> Self
pub fn with_websocket_url(self, websocket_url: impl Into<String>) -> Self
Sets the independent complete WS(S) subscription target.
Sourcepub fn with_websocket(self, websocket_url: impl Into<String>) -> Self
pub fn with_websocket(self, websocket_url: impl Into<String>) -> Self
Sets the independent complete WS(S) subscription target.
Sourcepub fn with_header(
self,
name: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_header( self, name: impl Into<String>, value: impl Into<String>, ) -> Self
Adds an HTTP header scoped to this endpoint.
Sourcepub fn with_headers<I, N, V>(self, headers: I) -> Self
pub fn with_headers<I, N, V>(self, headers: I) -> Self
Replaces the endpoint-scoped headers.
Trait Implementations§
Source§impl Clone for RpcEndpointConfig
impl Clone for RpcEndpointConfig
Source§impl Debug for RpcEndpointConfig
impl Debug for RpcEndpointConfig
Source§impl Default for RpcEndpointConfig
impl Default for RpcEndpointConfig
Source§impl From<&str> for RpcEndpointConfig
impl From<&str> for RpcEndpointConfig
Auto Trait Implementations§
impl Freeze for RpcEndpointConfig
impl RefUnwindSafe for RpcEndpointConfig
impl Send for RpcEndpointConfig
impl Sync for RpcEndpointConfig
impl Unpin for RpcEndpointConfig
impl UnsafeUnpin for RpcEndpointConfig
impl UnwindSafe for RpcEndpointConfig
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