pub struct PositiveIsize(/* private fields */);
Expand description
An isize
that is strictly positive (greater than 0).
PositiveIsize
differs from NonZeroUsize
in that it is guaranteed to
fit in an isize
(i.e. the maximum value is isize::MAX
as opposed to
usize::MAX
).
Implementations§
Source§impl PositiveIsize
impl PositiveIsize
Sourcepub const fn new(value: isize) -> Option<Self>
pub const fn new(value: isize) -> Option<Self>
Creates a new PositiveIsize
from an isize
value.
Returns None
if value
is less than or equal to zero.
Sourcepub const fn new_unsigned(value: usize) -> Option<Self>
pub const fn new_unsigned(value: usize) -> Option<Self>
Creates a new PositiveIsize
from a usize
value.
Returns None
if value
is zero or larger than isize::MAX
.
Trait Implementations§
Source§impl Clone for PositiveIsize
impl Clone for PositiveIsize
Source§fn clone(&self) -> PositiveIsize
fn clone(&self) -> PositiveIsize
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 PositiveIsize
impl Debug for PositiveIsize
Source§impl From<PositiveIsize> for NonZeroIsize
impl From<PositiveIsize> for NonZeroIsize
Source§fn from(PositiveIsize: PositiveIsize) -> Self
fn from(PositiveIsize: PositiveIsize) -> Self
Converts to this type from the input type.
Source§impl From<PositiveIsize> for NonZeroUsize
impl From<PositiveIsize> for NonZeroUsize
Source§fn from(PositiveIsize: PositiveIsize) -> Self
fn from(PositiveIsize: PositiveIsize) -> Self
Converts to this type from the input type.
Source§impl From<PositiveIsize> for isize
impl From<PositiveIsize> for isize
Source§fn from(PositiveIsize: PositiveIsize) -> Self
fn from(PositiveIsize: PositiveIsize) -> Self
Converts to this type from the input type.
Source§impl From<PositiveIsize> for usize
impl From<PositiveIsize> for usize
Source§fn from(PositiveIsize: PositiveIsize) -> Self
fn from(PositiveIsize: PositiveIsize) -> Self
Converts to this type from the input type.
Source§impl Hash for PositiveIsize
impl Hash for PositiveIsize
Source§impl Ord for PositiveIsize
impl Ord for PositiveIsize
Source§fn cmp(&self, other: &PositiveIsize) -> Ordering
fn cmp(&self, other: &PositiveIsize) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PositiveIsize
impl PartialEq for PositiveIsize
Source§impl PartialOrd for PositiveIsize
impl PartialOrd for PositiveIsize
impl Copy for PositiveIsize
impl Eq for PositiveIsize
impl StructuralPartialEq for PositiveIsize
Auto Trait Implementations§
impl Freeze for PositiveIsize
impl RefUnwindSafe for PositiveIsize
impl Send for PositiveIsize
impl Sync for PositiveIsize
impl Unpin for PositiveIsize
impl UnwindSafe for PositiveIsize
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,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
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§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more