#[non_exhaustive]pub enum Quantisation {
StepSize,
None,
}Available on crate feature
tariffs only.Expand description
Whether consumed quantities are billed in step_size blocks.
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.
StepSize
Round each quantity up to the next multiple of the applicable step_size, as OCPI 2.x
prescribes.
None
Bill the measured quantity exactly, as OCPI 3.0 will.
Implementations§
Source§impl Quantisation
impl Quantisation
Sourcepub fn apply(self, quantity: Number, step_size: u32, unit_scale: u32) -> Number
pub fn apply(self, quantity: Number, step_size: u32, unit_scale: u32) -> Number
Rounds quantity up to the next multiple of step_size units.
unit_scale converts the quantity into the unit step_size counts: 1000 for ENERGY
(kWh measured, Wh counted) and 3600 for the time dimensions (hours measured, seconds
counted).
Consumed amounts are rounded up to the smallest multiple of
step_sizethat is greater than the consumed amount.
Trait Implementations§
Source§impl Clone for Quantisation
impl Clone for Quantisation
Source§fn clone(&self) -> Quantisation
fn clone(&self) -> Quantisation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for Quantisation
Source§impl Debug for Quantisation
impl Debug for Quantisation
impl Eq for Quantisation
Source§impl PartialEq for Quantisation
impl PartialEq for Quantisation
impl StructuralPartialEq for Quantisation
Auto Trait Implementations§
impl Freeze for Quantisation
impl RefUnwindSafe for Quantisation
impl Send for Quantisation
impl Sync for Quantisation
impl Unpin for Quantisation
impl UnsafeUnpin for Quantisation
impl UnwindSafe for Quantisation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
key and return true if they are equal.