#[non_exhaustive]pub enum SessionStatus {
Active,
Completed,
Invalid,
Pending,
Custom(String),
}v2_1_1 only.Expand description
The state of a session, in OCPI 2.1.1.
RESERVATION arrived in OCPI 2.2, with the reservation pricing that needed it.
Spec: 2.1.1 §mod_sessions_sessionstatus_enum
The specification declares this enum closed. This crate still decodes an
unrecognised value into Custom rather than failing the whole
object, and Validate reports it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Active
The session is accepted and active.
Wire value: ACTIVE
Completed
The session has finished successfully.
Wire value: COMPLETED
Invalid
The session is declared invalid and will not be billed.
Wire value: INVALID
Pending
The session is pending; it has not yet started.
Wire value: PENDING
Custom(String)
A value this version of the specification does not define, preserved verbatim.
The variant is named Custom rather than Other because several OCPI OpenEnums
have a defined value that is literally OTHER.
Implementations§
Source§impl SessionStatus
impl SessionStatus
Sourcepub const ALL_KNOWN: &'static [Self]
pub const ALL_KNOWN: &'static [Self]
Every value this version of the specification defines, in declaration order.
Sourcepub const ALL_KNOWN_WIRE: &'static [&'static str]
pub const ALL_KNOWN_WIRE: &'static [&'static str]
Every wire value this version of the specification defines.
Sourcepub fn from_str_ignore_case(s: &str) -> Self
pub fn from_str_ignore_case(s: &str) -> Self
Parses a wire value, ignoring ASCII case for the known values.
For peers that get the case wrong; FromStr is strict.
Source§impl SessionStatus
impl SessionStatus
Sourcepub fn is_terminal(&self) -> bool
pub fn is_terminal(&self) -> bool
Whether the session can still change.
Trait Implementations§
Source§impl Clone for SessionStatus
impl Clone for SessionStatus
Source§fn clone(&self) -> SessionStatus
fn clone(&self) -> SessionStatus
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionStatus
impl Debug for SessionStatus
Source§impl<'de> Deserialize<'de> for SessionStatus
impl<'de> Deserialize<'de> for SessionStatus
Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Source§impl Display for SessionStatus
impl Display for SessionStatus
impl Eq for SessionStatus
Source§impl From<&str> for SessionStatus
impl From<&str> for SessionStatus
Source§impl FromStr for SessionStatus
impl FromStr for SessionStatus
Source§impl Hash for SessionStatus
impl Hash for SessionStatus
Source§impl JsonSchema for SessionStatus
impl JsonSchema for SessionStatus
Source§fn json_schema(_g: &mut SchemaGenerator) -> Schema
fn json_schema(_g: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl Ord for SessionStatus
impl Ord for SessionStatus
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for SessionStatus
impl PartialEq for SessionStatus
Source§impl PartialOrd for SessionStatus
impl PartialOrd for SessionStatus
Source§impl Serialize for SessionStatus
impl Serialize for SessionStatus
Source§impl Validate for SessionStatus
impl Validate for SessionStatus
Auto Trait Implementations§
impl Freeze for SessionStatus
impl RefUnwindSafe for SessionStatus
impl Send for SessionStatus
impl Sync for SessionStatus
impl Unpin for SessionStatus
impl UnsafeUnpin for SessionStatus
impl UnwindSafe for SessionStatus
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
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<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
key and return true if they are equal.