pub struct BindTo {
pub addr: Option<SocketAddr>,
/* private fields */
}
Expand description
Settings for binding on connect
Fields§
§addr: Option<SocketAddr>
Implementations§
Source§impl BindTo
impl BindTo
Sourcepub fn set_port_range(&mut self, range: Option<(u16, u16)>) -> Result<()>
pub fn set_port_range(&mut self, range: Option<(u16, u16)>) -> Result<()>
Sets the port range we will bind to where the first item in the tuple is the lower bound and the second item is the upper bound.
Note this bind option is only supported on Linux since 6.3, this is a no-op on other systems.
To reset the range, pass a None
or Some((0,0))
, more information can be found here
Sourcepub fn set_fallback(&mut self, fallback: bool)
pub fn set_fallback(&mut self, fallback: bool)
Set whether we fallback on no address available if a port range is set
Sourcepub fn port_range(&self) -> Option<(u16, u16)>
pub fn port_range(&self) -> Option<(u16, u16)>
Configured bind port range
Sourcepub fn will_fallback(&self) -> bool
pub fn will_fallback(&self) -> bool
Whether we attempt to fallback on no address available
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BindTo
impl RefUnwindSafe for BindTo
impl Send for BindTo
impl Sync for BindTo
impl Unpin for BindTo
impl UnwindSafe for BindTo
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,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)