pub struct Domain(/* private fields */);
Expand description
Specification of the communication domain for a socket.
This is a newtype wrapper around an integer which provides a nicer API in
addition to an injection point for documentation. Convenience constants such
as Domain::IPV4
, Domain::IPV6
, etc, are provided to avoid reaching
into libc for various constants.
This type is freely interconvertible with C’s int
type, however, if a raw
value needs to be provided.
Implementations§
Source§impl Domain
impl Domain
Unix only API.
Source§impl Domain
impl Domain
Sourcepub const fn for_address(address: SocketAddr) -> Domain
pub const fn for_address(address: SocketAddr) -> Domain
Returns the correct domain for address
.
Trait Implementations§
impl Copy for Domain
impl Eq for Domain
impl StructuralPartialEq for Domain
Auto Trait Implementations§
impl Freeze for Domain
impl RefUnwindSafe for Domain
impl Send for Domain
impl Sync for Domain
impl Unpin for Domain
impl UnwindSafe for Domain
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 4 bytes