pub struct ValidatorInternalNetworkPreConfig<P> {
pub protocol: P,
pub shards: Vec<ShardConfig>,
pub host: String,
pub port: u16,
pub metrics_host: String,
pub metrics_port: u16,
}
Expand description
The network configuration for all shards.
Fields§
§protocol: P
The network protocol to use for all shards.
shards: Vec<ShardConfig>
The available shards. Each chain UID is mapped to a unique shard in the vector in a static way.
host: String
The host name of the proxy on the internal network (IP or hostname).
port: u16
The port the proxy listens on on the internal network.
metrics_host: String
The host name of the proxy’s metrics endpoint.
metrics_port: u16
The port of the proxy’s metrics endpoint.
Implementations§
Source§impl<P> ValidatorInternalNetworkPreConfig<P>
impl<P> ValidatorInternalNetworkPreConfig<P>
pub fn clone_with_protocol<Q>( &self, protocol: Q, ) -> ValidatorInternalNetworkPreConfig<Q>
Source§impl ValidatorInternalNetworkPreConfig<NetworkProtocol>
impl ValidatorInternalNetworkPreConfig<NetworkProtocol>
pub fn proxy_address(&self) -> String
Source§impl<P> ValidatorInternalNetworkPreConfig<P>
impl<P> ValidatorInternalNetworkPreConfig<P>
Sourcepub fn get_shard_id(&self, chain_id: ChainId) -> ShardId
pub fn get_shard_id(&self, chain_id: ChainId) -> ShardId
Static shard assignment
pub fn shard(&self, shard_id: ShardId) -> &ShardConfig
Sourcepub fn get_shard_for(&self, chain_id: ChainId) -> &ShardConfig
pub fn get_shard_for(&self, chain_id: ChainId) -> &ShardConfig
Gets the ShardConfig
of the shard assigned to the chain_id
.
Trait Implementations§
Source§impl<P: Clone> Clone for ValidatorInternalNetworkPreConfig<P>
impl<P: Clone> Clone for ValidatorInternalNetworkPreConfig<P>
Source§fn clone(&self) -> ValidatorInternalNetworkPreConfig<P>
fn clone(&self) -> ValidatorInternalNetworkPreConfig<P>
Returns a copy 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<P: Debug> Debug for ValidatorInternalNetworkPreConfig<P>
impl<P: Debug> Debug for ValidatorInternalNetworkPreConfig<P>
Source§impl<'de, P> Deserialize<'de> for ValidatorInternalNetworkPreConfig<P>where
P: Deserialize<'de>,
impl<'de, P> Deserialize<'de> for ValidatorInternalNetworkPreConfig<P>where
P: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<P: PartialEq> PartialEq for ValidatorInternalNetworkPreConfig<P>
impl<P: PartialEq> PartialEq for ValidatorInternalNetworkPreConfig<P>
Source§fn eq(&self, other: &ValidatorInternalNetworkPreConfig<P>) -> bool
fn eq(&self, other: &ValidatorInternalNetworkPreConfig<P>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<P> Serialize for ValidatorInternalNetworkPreConfig<P>where
P: Serialize,
impl<P> Serialize for ValidatorInternalNetworkPreConfig<P>where
P: Serialize,
impl<P: Eq> Eq for ValidatorInternalNetworkPreConfig<P>
impl<P> StructuralPartialEq for ValidatorInternalNetworkPreConfig<P>
Auto Trait Implementations§
impl<P> Freeze for ValidatorInternalNetworkPreConfig<P>where
P: Freeze,
impl<P> RefUnwindSafe for ValidatorInternalNetworkPreConfig<P>where
P: RefUnwindSafe,
impl<P> Send for ValidatorInternalNetworkPreConfig<P>where
P: Send,
impl<P> Sync for ValidatorInternalNetworkPreConfig<P>where
P: Sync,
impl<P> Unpin for ValidatorInternalNetworkPreConfig<P>where
P: Unpin,
impl<P> UnwindSafe for ValidatorInternalNetworkPreConfig<P>where
P: UnwindSafe,
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
impl<Choices> CoproductSubsetter<CNil, HNil> for Choices
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request
Source§impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
impl<M, I> RuntimeMemory<&mut I> for Mwhere
M: RuntimeMemory<I>,
Source§fn read<'instance>(
&self,
instance: &'instance &mut I,
location: GuestPointer,
length: u32,
) -> Result<Cow<'instance, [u8]>, RuntimeError>
fn read<'instance>( &self, instance: &'instance &mut I, location: GuestPointer, length: u32, ) -> Result<Cow<'instance, [u8]>, RuntimeError>
Reads length
bytes from memory from the provided location
.
Source§fn write(
&mut self,
instance: &mut &mut I,
location: GuestPointer,
bytes: &[u8],
) -> Result<(), RuntimeError>
fn write( &mut self, instance: &mut &mut I, location: GuestPointer, bytes: &[u8], ) -> Result<(), RuntimeError>
Writes the bytes
to memory at the provided location
.