pub enum ClockError {
Unavailable(String),
NotSynced(String),
InvalidSampleRate(u32),
ConversionOverflow,
Core(AudioError),
Io(Error),
}Expand description
Errors returned by clock-source operations.
These cover the two concerns of this crate:
- Clock availability / sync — whether a usable time reference exists at
all (PTP daemon reachable, NTP synced). Represented by
ClockError::UnavailableandClockError::NotSynced. - Conversion integrity — sample-rate validation and the checked
arithmetic that guards
crate::ClockSource::sample_to_ptp/crate::ClockSource::ptp_to_sampleagainst overflow. Represented byClockError::InvalidSampleRate,ClockError::ConversionOverflow, and the core-delegatedClockError::Core.
Variants§
No clock source is available on this host (e.g. no PTP daemon running, no PTP-capable NIC).
NotSynced(String)
The clock exists but has not yet synchronised (e.g. NTP still converging, PTP master not yet locked).
InvalidSampleRate(u32)
The provided sample rate is not a positive, supported value.
ConversionOverflow
A sample-index ↔ timestamp conversion would overflow i64.
This indicates an anchor or sample index absurdly far from the clock’s reference point; callers should re-anchor closer to the working range.
Core(AudioError)
A validation failure delegated to the shared core types.
Io(Error)
A raw I/O error from the operating system (e.g. reading a PTP device).
Trait Implementations§
Source§impl Debug for ClockError
impl Debug for ClockError
Source§impl Display for ClockError
impl Display for ClockError
Source§impl Error for ClockError
impl Error for ClockError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<AudioError> for ClockError
impl From<AudioError> for ClockError
Source§fn from(source: AudioError) -> Self
fn from(source: AudioError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for ClockError
impl !UnwindSafe for ClockError
impl Freeze for ClockError
impl Send for ClockError
impl Sync for ClockError
impl Unpin for ClockError
impl UnsafeUnpin for ClockError
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