pub struct SectionInterval(/* private fields */);Expand description
The inter-section repetition interval of one table (EN 300 468 §5.1.4.1):
a Duration that is never below MIN_SECTION_INTERVAL.
The 25 ms floor used to be a debug_assert! inside SiMux::upsert, so a
release build accepted Duration::ZERO (one section every poll) silently.
The bound is a property of the interval itself, so it is checked here, once.
Implementations§
Source§impl SectionInterval
impl SectionInterval
Sourcepub const fn try_new(
interval: Duration,
) -> Result<Self, SectionIntervalTooShort>
pub const fn try_new( interval: Duration, ) -> Result<Self, SectionIntervalTooShort>
Validate interval against the EN 300 468 §5.1.4.1 25 ms floor.
§Errors
SectionIntervalTooShort when interval < MIN_SECTION_INTERVAL.
Sourcepub const fn from_const(interval: Duration) -> Self
pub const fn from_const(interval: Duration) -> Self
Validate at compile time, for the spec’s own named intervals
(PAT_MAX_INTERVAL and friends): a mistyped interval is then a build
error rather than a run-time try_new.
§Panics
In a const context, when interval < MIN_SECTION_INTERVAL.
Trait Implementations§
Source§impl Clone for SectionInterval
impl Clone for SectionInterval
impl Copy for SectionInterval
Source§impl Debug for SectionInterval
impl Debug for SectionInterval
impl Eq for SectionInterval
Source§impl From<SectionInterval> for Duration
impl From<SectionInterval> for Duration
Source§fn from(interval: SectionInterval) -> Self
fn from(interval: SectionInterval) -> Self
Converts to this type from the input type.
Source§impl Hash for SectionInterval
impl Hash for SectionInterval
Source§impl Ord for SectionInterval
impl Ord for SectionInterval
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 SectionInterval
impl PartialEq for SectionInterval
Source§impl PartialOrd for SectionInterval
impl PartialOrd for SectionInterval
Source§impl Serialize for SectionInterval
Available on crate feature serde only.
impl Serialize for SectionInterval
Available on crate feature
serde only.impl StructuralPartialEq for SectionInterval
Auto Trait Implementations§
impl Forget for SectionInterval
impl Freeze for SectionInterval
impl Move for SectionInterval
impl RefUnwindSafe for SectionInterval
impl Send for SectionInterval
impl Sync for SectionInterval
impl Unpin for SectionInterval
impl UnsafeUnpin for SectionInterval
impl UnwindSafe for SectionInterval
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