pub struct StackAddr { /* private fields */ }Expand description
A stack address that contains a stack of protocols. The stack address can be used to represent a network address with multiple protocols.
Implementations§
Source§impl StackAddr
impl StackAddr
pub fn new(segments: Vec<Segment>) -> Self
pub fn from_parts(segments: &[Segment]) -> Self
pub fn empty() -> Self
pub fn with(self, segment: Segment) -> Self
pub fn with_protocol(self, protocol: Protocol) -> Self
pub fn with_identity(self, identity: Identity) -> Self
pub fn with_path(self, path: &str) -> Self
pub fn with_meta(self, key: &str, value: &str) -> Self
pub fn with_mac(self, addr: &str) -> Self
pub fn with_ipv4(self, addr: Ipv4Addr) -> Self
pub fn with_ipv6(self, addr: Ipv6Addr) -> Self
pub fn with_ip(self, addr: IpAddr) -> Self
pub fn with_dns_name(self, name: &str) -> Self
pub fn segments(&self) -> &[Segment]
pub fn push(&mut self, segment: Segment)
pub fn pop(&mut self) -> Option<Segment>
pub fn contains(&self, target: &Segment) -> bool
pub fn replace(&mut self, old: &Segment, new: Segment) -> bool
pub fn replace_all(&mut self, old: &Segment, new: Segment) -> usize
pub fn remove(&mut self, target: &Segment) -> bool
pub fn remove_all(&mut self, target: &Segment) -> usize
pub fn ip(&self) -> Option<IpAddr>
pub fn port(&self) -> Option<u16>
pub fn name(&self) -> Option<&str>
pub fn resolved(&self) -> bool
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Ord for StackAddr
impl Ord for StackAddr
Source§impl PartialOrd for StackAddr
impl PartialOrd for StackAddr
impl Eq for StackAddr
impl StructuralPartialEq for StackAddr
Auto Trait Implementations§
impl Freeze for StackAddr
impl RefUnwindSafe for StackAddr
impl Send for StackAddr
impl Sync for StackAddr
impl Unpin for StackAddr
impl UnwindSafe for StackAddr
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