pub struct SizeType(_);
Expand description
Wraps tsk_size_t
This type plays the role of C’s size_t
in the tskit
C library.
Examples
let s = tskit::SizeType::from(1 as tskit::bindings::tsk_size_t);
let mut t: tskit::bindings::tsk_size_t = s.into();
assert!(t == s);
assert!(t == 1);
let u = tskit::SizeType::from(s);
assert!(u == s);
t += 1;
assert!(t > s);
assert!(s < t);
#[repr(transparent)]
Trait Implementations
sourceimpl From<SizeType> for tsk_size_t
impl From<SizeType> for tsk_size_t
sourceimpl From<u64> for SizeType
impl From<u64> for SizeType
sourcefn from(value: tsk_size_t) -> Self
fn from(value: tsk_size_t) -> Self
Converts to this type from the input type.
sourceimpl Ord for SizeType
impl Ord for SizeType
1.21.0 · sourcefn 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 · sourcefn 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
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<MigrationId> for SizeType
impl PartialEq<MigrationId> for SizeType
sourcefn eq(&self, other: &MigrationId) -> bool
fn eq(&self, other: &MigrationId) -> bool
sourceimpl PartialEq<MutationId> for SizeType
impl PartialEq<MutationId> for SizeType
sourcefn eq(&self, other: &MutationId) -> bool
fn eq(&self, other: &MutationId) -> bool
sourceimpl PartialEq<PopulationId> for SizeType
impl PartialEq<PopulationId> for SizeType
sourcefn eq(&self, other: &PopulationId) -> bool
fn eq(&self, other: &PopulationId) -> bool
sourceimpl PartialOrd<EdgeId> for SizeType
impl PartialOrd<EdgeId> for SizeType
sourcefn partial_cmp(&self, other: &EdgeId) -> Option<Ordering>
fn partial_cmp(&self, other: &EdgeId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<MigrationId> for SizeType
impl PartialOrd<MigrationId> for SizeType
sourcefn partial_cmp(&self, other: &MigrationId) -> Option<Ordering>
fn partial_cmp(&self, other: &MigrationId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<MutationId> for SizeType
impl PartialOrd<MutationId> for SizeType
sourcefn partial_cmp(&self, other: &MutationId) -> Option<Ordering>
fn partial_cmp(&self, other: &MutationId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<NodeId> for SizeType
impl PartialOrd<NodeId> for SizeType
sourcefn partial_cmp(&self, other: &NodeId) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<PopulationId> for SizeType
impl PartialOrd<PopulationId> for SizeType
sourcefn partial_cmp(&self, other: &PopulationId) -> Option<Ordering>
fn partial_cmp(&self, other: &PopulationId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SiteId> for SizeType
impl PartialOrd<SiteId> for SizeType
sourcefn partial_cmp(&self, other: &SiteId) -> Option<Ordering>
fn partial_cmp(&self, other: &SiteId) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for EdgeId
impl PartialOrd<SizeType> for EdgeId
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for MigrationId
impl PartialOrd<SizeType> for MigrationId
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for MutationId
impl PartialOrd<SizeType> for MutationId
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for NodeId
impl PartialOrd<SizeType> for NodeId
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for PopulationId
impl PartialOrd<SizeType> for PopulationId
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for SiteId
impl PartialOrd<SizeType> for SiteId
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for SizeType
impl PartialOrd<SizeType> for SizeType
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<SizeType> for tsk_size_t
impl PartialOrd<SizeType> for tsk_size_t
sourcefn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
fn partial_cmp(&self, other: &SizeType) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<u64> for SizeType
impl PartialOrd<u64> for SizeType
sourcefn partial_cmp(&self, other: &tsk_size_t) -> Option<Ordering>
fn partial_cmp(&self, other: &tsk_size_t) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl TryFrom<IndividualId> for SizeType
impl TryFrom<IndividualId> for SizeType
type Error = TskitError
type Error = TskitError
The type returned in the event of a conversion error.
sourcefn try_from(value: IndividualId) -> Result<Self, Self::Error>
fn try_from(value: IndividualId) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<MigrationId> for SizeType
impl TryFrom<MigrationId> for SizeType
type Error = TskitError
type Error = TskitError
The type returned in the event of a conversion error.
sourcefn try_from(value: MigrationId) -> Result<Self, Self::Error>
fn try_from(value: MigrationId) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<MutationId> for SizeType
impl TryFrom<MutationId> for SizeType
type Error = TskitError
type Error = TskitError
The type returned in the event of a conversion error.
sourcefn try_from(value: MutationId) -> Result<Self, Self::Error>
fn try_from(value: MutationId) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<PopulationId> for SizeType
impl TryFrom<PopulationId> for SizeType
type Error = TskitError
type Error = TskitError
The type returned in the event of a conversion error.
sourcefn try_from(value: PopulationId) -> Result<Self, Self::Error>
fn try_from(value: PopulationId) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<ProvenanceId> for SizeType
impl TryFrom<ProvenanceId> for SizeType
type Error = TskitError
type Error = TskitError
The type returned in the event of a conversion error.
sourcefn try_from(value: ProvenanceId) -> Result<Self, Self::Error>
fn try_from(value: ProvenanceId) -> Result<Self, Self::Error>
Performs the conversion.
impl Copy for SizeType
impl Eq for SizeType
impl StructuralEq for SizeType
impl StructuralPartialEq for SizeType
Auto Trait Implementations
impl RefUnwindSafe for SizeType
impl Send for SizeType
impl Sync for SizeType
impl Unpin for SizeType
impl UnwindSafe for SizeType
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more