Struct abstract_ns::AddressBuilder
[−]
[src]
pub struct AddressBuilder { /* fields omitted */ }
A builder interface for Address
Example
use abstract_ns::AddressBuilder; let mut builder = AddressBuilder::new(); builder.add_addresses(&[(1, "127.0.0.1:80".parse().unwrap())]); let addr = builder.into_address();
Methods
impl AddressBuilder
[src]
fn new() -> AddressBuilder
Create a new empty address builder
fn add_addresses<'x, I>(&mut self, items: I) -> &mut AddressBuilder where I: IntoIterator<Item=&'x (Weight, SocketAddr)>
Add set of addresses of the same priority
You must add all addresses of the same priority with a single call
to this function. Next call to add_addresses
will add addresses with
smaller priority
fn into_address(self) -> Address
Finish building the Address object
Returns none if there is no single address in the builder