#[non_exhaustive]pub enum SessionError {
IllegalTransition {
from: SessionState,
to: SessionState,
},
AlreadyEnded,
EndsBeforeItStarts {
started_at: OffsetDateTime,
ended_at: OffsetDateTime,
},
TimeWentBackwards {
previous: OffsetDateTime,
at: OffsetDateTime,
},
DuplicateDirection {
direction: Direction,
},
NoSeries {
direction: Direction,
},
Split(SplitError),
}Expand description
What can be wrong with a session.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
IllegalTransition
The protocol does not allow this transition.
AlreadyEnded
Something was added after the session ended.
EndsBeforeItStarts
The end precedes the start.
Fields
§
started_at: OffsetDateTimeWhen it started.
§
ended_at: OffsetDateTimeWhen it supposedly ended.
TimeWentBackwards
A transition is dated before the one it follows.
Fields
§
previous: OffsetDateTimeThe last transition’s instant.
§
at: OffsetDateTimeThe instant offered.
DuplicateDirection
A second series for a direction that already has one.
NoSeries
The direction has no readings.
Split(SplitError)
The readings could not be split across quarter hours.
Trait Implementations§
Source§impl Clone for SessionError
impl Clone for SessionError
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
impl Eq for SessionError
Source§impl Error for SessionError
impl Error for SessionError
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<SplitError> for SessionError
impl From<SplitError> for SessionError
Source§fn from(source: SplitError) -> Self
fn from(source: SplitError) -> Self
Converts to this type from the input type.
Source§impl PartialEq for SessionError
impl PartialEq for SessionError
impl StructuralPartialEq for SessionError
Auto Trait Implementations§
impl Forget for SessionError
impl Freeze for SessionError
impl Move for SessionError
impl RefUnwindSafe for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnsafeUnpin for SessionErrorwhere
NonZeroI32Inner: UnsafeUnpin,
impl UnwindSafe for SessionError
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