pub struct Profile<'a, const N: usize> { /* private fields */ }Expand description
Retains the latest N qualified samples since the previous block. Consume or copy each block before recording the next slot.
Implementations§
Source§impl<'a, const N: usize> Profile<'a, N>
impl<'a, const N: usize> Profile<'a, N>
pub fn new(config: Config<'a>) -> Result<Self, Error>
Sourcepub fn record(
&mut self,
channel: Channel<'_>,
utc: i64,
value: Option<Value>,
) -> Result<Option<Block<'_>>, Error>
pub fn record( &mut self, channel: Channel<'_>, utc: i64, value: Option<Value>, ) -> Result<Option<Block<'_>>, Error>
Submit each reception slot, passing None for a missing or invalid sample.
A gap breaks threshold comparison and still advances the periodic schedule.
Rejected inputs leave the slot and pending block intact.
Auto Trait Implementations§
impl<'a, const N: usize> Freeze for Profile<'a, N>
impl<'a, const N: usize> RefUnwindSafe for Profile<'a, N>
impl<'a, const N: usize> Send for Profile<'a, N>
impl<'a, const N: usize> Sync for Profile<'a, N>
impl<'a, const N: usize> Unpin for Profile<'a, N>
impl<'a, const N: usize> UnsafeUnpin for Profile<'a, N>
impl<'a, const N: usize> UnwindSafe for Profile<'a, N>
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