pub struct RpcBuilder {
pub no_restart: bool,
pub socket: SocketAddr,
pub enable_admin: bool,
pub admin_persistence: Option<PathBuf>,
pub ws_enabled: bool,
pub dev_enabled: bool,
}Expand description
The RPC configuration.
Fields§
§no_restart: boolPrevent the rpc server from being restarted.
socket: SocketAddrThe RPC socket address.
enable_admin: boolEnable the admin API.
admin_persistence: Option<PathBuf>File path used to persist state changes made via the admin API so they persist across restarts.
ws_enabled: boolEnable the websocket rpc server
dev_enabled: boolEnable development RPC endpoints
Implementations§
Source§impl RpcBuilder
impl RpcBuilder
Sourcepub const fn ws_enabled(&self) -> bool
pub const fn ws_enabled(&self) -> bool
Returns whether WebSocket RPC endpoint is enabled
Sourcepub const fn dev_enabled(&self) -> bool
pub const fn dev_enabled(&self) -> bool
Returns whether development RPC endpoints are enabled
Sourcepub const fn socket(&self) -> SocketAddr
pub const fn socket(&self) -> SocketAddr
Returns the socket address of the RpcBuilder.
Sourcepub const fn restart_count(&self) -> u32
pub const fn restart_count(&self) -> u32
Returns the number of times the RPC server will attempt to restart if it stops.
Sourcepub fn set_addr(self, addr: SocketAddr) -> Self
pub fn set_addr(self, addr: SocketAddr) -> Self
Sets the given SocketAddr on the RpcBuilder.
Trait Implementations§
Source§impl Clone for RpcBuilder
impl Clone for RpcBuilder
Source§fn clone(&self) -> RpcBuilder
fn clone(&self) -> RpcBuilder
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 moreAuto Trait Implementations§
impl Freeze for RpcBuilder
impl RefUnwindSafe for RpcBuilder
impl Send for RpcBuilder
impl Sync for RpcBuilder
impl Unpin for RpcBuilder
impl UnwindSafe for RpcBuilder
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 more