pub struct OptionalI32(/* private fields */);Expand description
A signed number that may be absent.
Sequence positions and the depositor’s own residue numbers use this: both are genuinely optional, and both may legitimately be negative, so the reserved value is the one no numbering scheme reaches.
§Examples
use molframe_core::OptionalI32;
assert_eq!(OptionalI32::some(-5).get(), Some(-5));
assert_eq!(OptionalI32::NONE.get(), None);
assert_eq!(size_of::<OptionalI32>(), 4);Implementations§
Trait Implementations§
Source§impl Clone for OptionalI32
impl Clone for OptionalI32
impl Copy for OptionalI32
Source§impl Debug for OptionalI32
impl Debug for OptionalI32
Source§impl Default for OptionalI32
impl Default for OptionalI32
impl Eq for OptionalI32
Source§impl From<OptionalI32> for Option<i32>
impl From<OptionalI32> for Option<i32>
Source§fn from(optional: OptionalI32) -> Self
fn from(optional: OptionalI32) -> Self
Converts to this type from the input type.
Source§impl Hash for OptionalI32
impl Hash for OptionalI32
Source§impl Ord for OptionalI32
impl Ord for OptionalI32
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for OptionalI32
impl PartialEq for OptionalI32
Source§impl PartialOrd for OptionalI32
impl PartialOrd for OptionalI32
impl StructuralPartialEq for OptionalI32
Auto Trait Implementations§
impl Freeze for OptionalI32
impl RefUnwindSafe for OptionalI32
impl Send for OptionalI32
impl Sync for OptionalI32
impl Unpin for OptionalI32
impl UnsafeUnpin for OptionalI32
impl UnwindSafe for OptionalI32
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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