#[non_exhaustive]pub enum Subject {
Contract {
id: ContractId,
emaid: Option<Emaid>,
},
AdHoc,
}Expand description
Who the session is for.
An ad-hoc session has no contract by construction, which is why this is an
enum rather than an Option<ContractId>: “no contract” and “contract not
recorded” are different facts, and only the first one is lawful to bill
against an ad-hoc tariff.
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.
Contract
A contract at an e-mobility provider.
Fields
§
id: ContractIdThe provider-side contract.
AdHoc
A driver with no contract, paying at the point.
Implementations§
Source§impl Subject
impl Subject
Sourcepub const fn contract_id(&self) -> Option<&ContractId>
pub const fn contract_id(&self) -> Option<&ContractId>
The contract, if there is one.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Subject
impl<'de> Deserialize<'de> for Subject
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Subject
impl StructuralPartialEq for Subject
Auto Trait Implementations§
impl Forget for Subject
impl Freeze for Subject
impl Move for Subject
impl RefUnwindSafe for Subject
impl Send for Subjectwhere
RawVecInner: Send,
impl Sync for Subjectwhere
RawVecInner: Sync,
impl Unpin for Subject
impl UnsafeUnpin for Subject
impl UnwindSafe for Subjectwhere
RawVecInner: UnwindSafe,
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