pub enum ConnectionParams {
Url(String),
IpPort(String, u16),
}Expand description
Represents the connection parameters for a Delta node.
ConnectionParams can be:
Url: A URL string to connect to a node.IpPort: An IP address and port combination to connect to a node.
Variants§
Url(String)
IpPort(String, u16)
Connection parameter representing an IP address and port.
§Fields
0- A string containing the IP address.1- A u16 containing the port number.
Implementations§
Source§impl ConnectionParams
impl ConnectionParams
Sourcepub fn is_ip_port(&self) -> bool
pub fn is_ip_port(&self) -> bool
Checks if the connection parameters are an IP address and port combination.
§Returns
A boolean indicating whether the connection parameters are an IP address and port combination.
§Examples
let params = ConnectionParams::IpPort("192.168.1.1".to_string(), 8080);
assert!(params.is_ip_port());
assert!(!params.is_url());Trait Implementations§
Source§impl Clone for ConnectionParams
impl Clone for ConnectionParams
Source§fn clone(&self) -> ConnectionParams
fn clone(&self) -> ConnectionParams
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 ConnectionParams
impl RefUnwindSafe for ConnectionParams
impl Send for ConnectionParams
impl Sync for ConnectionParams
impl Unpin for ConnectionParams
impl UnwindSafe for ConnectionParams
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