pub trait AddressInfoCollection:
Send
+ Sync
+ 'static {
// Required method
fn entries(&self) -> impl Iterator<Item: AddressInfoView + Send> + Send;
}Expand description
An owned resolver result whose representation is chosen by the backend. Borrowed entry views remain valid only while the result is borrowed. Iteration must preserve candidate ordering, duplicates, and native socket parameters without requiring a copied collection or per-entry reference counts.
Native implementations can traverse an owned addrinfo list directly and free it once through the matching native deallocator on drop. Validation may inspect that list without materializing portable records. Concrete result types may expose additional native accessors. Arrays, vectors, and shared cached storage can provide the same portable accessors without native layouts.
use base_scheduler::{AddressInfo, AddressInfoCollection, AddressInfoView, SocketType};
let entry = {
let result = [AddressInfo { address: "127.0.0.1:80".parse().unwrap(), socket_type: SocketType::Stream, protocol: None }];
result.entries().next().unwrap()
};
let address = entry.address(); // A borrowed entry cannot outlive its owner.Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".