pub struct Config { /* private fields */ }
Expand description
RPC and PubSub configuration.
Implementations
sourceimpl Config
impl Config
sourcepub fn add_rpc(&mut self, name: &str, addr: SocketAddr) -> Result<(), ConfigError>
pub fn add_rpc(&mut self, name: &str, addr: SocketAddr) -> Result<(), ConfigError>
Add an RPC config entry based on TCP port usage.
Args:
name
: The name to associate the config with.addr
: The TCP socket address to use for the RPC listener.
sourcepub fn get_rpc(&self, name: &str) -> Option<SocketAddr>
pub fn get_rpc(&self, name: &str) -> Option<SocketAddr>
Get the TCP port number for an RPC listener.
Args:
name
: The name in the config entries.
sourcepub fn add_pubsub(
&mut self,
topic: &str,
endpoint: &PubSubEndpoint
) -> Result<(), ConfigError>
pub fn add_pubsub(
&mut self,
topic: &str,
endpoint: &PubSubEndpoint
) -> Result<(), ConfigError>
Add a PubSub endpoint to the config.
Args:
topic
: The PubSub topic to add the endpoint to.endpoint
: An endpoint for a publisher to publish to.
sourcepub fn get_pubsub_endpoint(
&self,
topic: &str,
endpoint: &str
) -> Option<PubSubEndpoint>
pub fn get_pubsub_endpoint(
&self,
topic: &str,
endpoint: &str
) -> Option<PubSubEndpoint>
Get the config for a PubSub endpoint for a topic.
Args:
topic
: The PubSub topic to fetch endpoint configs for.endpoint
: The name of the PubSub endpoint to query.
sourcepub fn get_pubsub_topic(&self, topic: &str) -> Option<HashSet<PubSubEndpoint>>
pub fn get_pubsub_topic(&self, topic: &str) -> Option<HashSet<PubSubEndpoint>>
Get the set of endpoint configs for a PubSub topic.
Args:
topic
: The PubSub topic to fetch endpoint configs for.
sourcepub fn has_pubsub(&self, topic: &str) -> bool
pub fn has_pubsub(&self, topic: &str) -> bool
Check if a config exists for a PubSub topic.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
sourcefn 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
impl StructuralPartialEq for Config
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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