pub struct MultiAddr {
pub addrs: Vec<DualAddr>,
}Expand description
An address collection representing the local addresses of a MultiListener.
This struct contains all the addresses that the multi-listener is bound to.
It’s returned by the axum::serve::Listener::local_addr method implementation
for MultiListener.
§Examples
use axum_listener::multi::MultiListener;
use axum::serve::Listener;
let addresses = ["127.0.0.1:8080", "127.0.0.1:8081"];
let listener = MultiListener::bind(addresses).await.unwrap();
let multi_addr = listener.local_addr().unwrap();
println!("Bound to {} addresses", multi_addr.addrs.len());Fields§
§addrs: Vec<DualAddr>The collection of addresses that the multi-listener is bound to
Trait Implementations§
Source§impl Connected<IncomingStream<'_, MultiListener>> for MultiAddr
impl Connected<IncomingStream<'_, MultiListener>> for MultiAddr
Source§fn connect_info(stream: IncomingStream<'_, MultiListener>) -> Self
fn connect_info(stream: IncomingStream<'_, MultiListener>) -> Self
Create type holding information about the connection.
Auto Trait Implementations§
impl Freeze for MultiAddr
impl RefUnwindSafe for MultiAddr
impl Send for MultiAddr
impl Sync for MultiAddr
impl Unpin for MultiAddr
impl UnwindSafe for MultiAddr
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