pub struct Profile<'a> { /* private fields */ }Expand description
Single-channel evaluator. Each accepted close is consumed once per instance.
Implementations§
Source§impl<'a> Profile<'a>
impl<'a> Profile<'a>
Sourcepub fn new(
id: &'a str,
channel: Channel<'a>,
closes_utc: &'a [i64],
) -> Result<Self, Error>
pub fn new( id: &'a str, channel: Channel<'a>, closes_utc: &'a [i64], ) -> Result<Self, Error>
Commission explicit UTC closes. Calendar and profile validity are resolved upstream.
pub fn next_close(&self) -> Option<i64>
Sourcepub fn close(
&mut self,
channel: Channel<'_>,
entry: Entry,
) -> Result<Option<ClosingReading<'a>>, Error>
pub fn close( &mut self, channel: Channel<'_>, entry: Entry, ) -> Result<Option<ClosingReading<'a>>, Error>
Finalize an exact scheduled close. A valid reading produces one report.
A missing or invalid observation consumes the period and returns Ok(None).
An error leaves the period open. Finalize only after reception is complete.
Auto Trait Implementations§
impl<'a> Freeze for Profile<'a>
impl<'a> RefUnwindSafe for Profile<'a>
impl<'a> Send for Profile<'a>
impl<'a> Sync for Profile<'a>
impl<'a> Unpin for Profile<'a>
impl<'a> UnsafeUnpin for Profile<'a>
impl<'a> UnwindSafe for Profile<'a>
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