pub struct ShardAwarePortRange(/* private fields */);
Expand description
A range of ports that can be used for shard-aware connections.
The range is inclusive and has to be a sub-range of [1024, 65535].
Implementations§
Source§impl ShardAwarePortRange
impl ShardAwarePortRange
Sourcepub const EPHEMERAL_PORT_RANGE: Self
pub const EPHEMERAL_PORT_RANGE: Self
The default shard-aware local port range - [49152, 65535].
Sourcepub fn new(
range: impl Into<RangeInclusive<u16>>,
) -> Result<Self, InvalidShardAwarePortRange>
pub fn new( range: impl Into<RangeInclusive<u16>>, ) -> Result<Self, InvalidShardAwarePortRange>
Creates a new ShardAwarePortRange
with the given range.
The error is returned in two cases:
- Provided range is empty (
end
<start
). - Provided range starts at a port lower than 1024. Ports 0-1023 are reserved and should not be used by application.
Trait Implementations§
Source§impl Clone for ShardAwarePortRange
impl Clone for ShardAwarePortRange
Source§fn clone(&self) -> ShardAwarePortRange
fn clone(&self) -> ShardAwarePortRange
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ShardAwarePortRange
impl Debug for ShardAwarePortRange
Auto Trait Implementations§
impl Freeze for ShardAwarePortRange
impl RefUnwindSafe for ShardAwarePortRange
impl Send for ShardAwarePortRange
impl Sync for ShardAwarePortRange
impl Unpin for ShardAwarePortRange
impl UnwindSafe for ShardAwarePortRange
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more